06-27-2023 09:58 AM
Hi Richard,
richard.tiatco@sandc.com wrote:
Do I put the "0" on the time out terminal?
Let's think about it!
The question was: "How do I ouput a zero at the shutdown stage of my program?" and I showed you how to output a zero for an AO channel.
Now you are asking "Should I wire a zero to the timeout input of the DAQmxWrite function?"
What should be the purpose of setting a timeout to zero when you want to output a waveform containing (atleast) a "0" sample???
I guess you can give the answer yourself…
06-27-2023 02:53 PM
Thanks GerdW!
For now, I have a different priority.
I need to input two different values for two different test scenarios:
1. Test Scenario 1 - 6.2V Amplitude
2. Test Scenario 2 - 7 V Amplitude
Do I need to copy paste and just switch between programs or can I use single program and perform both without changing the amplitude of all channels one by one which is time consuming?
Thanks for all your help!
06-28-2023 12:35 AM
Hi Richard,
richard.tiatco@sandc.com wrote:
I need to input two different values for two different test scenarios:
1. Test Scenario 1 - 6.2V Amplitude
2. Test Scenario 2 - 7 V Amplitude
Do I need to copy paste and just switch between programs or can I use single program and perform both without changing the amplitude of all channels one by one which is time consuming?
Why do you want to duplicate code when all you need to change is a single scalar constant?
I recommend to use a boolean control and a Select node - as long as there are only exactly two cases (KISS)…
06-28-2023 08:19 AM
The easiest way is to keep the code you already have and have a control to select the test scenario you have, changing the amplitude only.
Now it depends on how you want to interact with the code. Does it run from the front panel with user interaction ? Is this going to be automated ? Like running scenario 1 then after a while scenario 2 without user intervention...
Now you need to give more details of the big picture of your project. We've been helping you to implement the basic function. But the way you implement depends on what your application will look like.
06-28-2023 09:10 AM
Thanks LVninja for replying back! Finally!
The code runs from the front panel with user interaction.
This is how the test process will run for each Equipment:
1. User will select the required amplitude value for Test 1 from the front panel.
2. User will press "Start" from the front panel.
3. User will check some parameters on the Equipment software (say <1minute)
4. User will press "Stop" from the front panel.
5. User will select the required amplitude value for Test 2 from the front panel.
6. User will press "Start" from the front panel.
7. User will check some parameters on the Equipment software (say <1minute)
8. User will press "Stop" from the front panel.
My requirements now are:
1. To put "Start" button on the code.
2. To create a logic for a selector to change the amplitude only. All other values stay the same for both Tests 1 & 2.
Thank you ALL for your help.
06-28-2023 01:16 PM
Thank you for clarifying.
In this case you can Have a Enum where you can define Test 1 and Test 2, the code will be connected to a case that will select 6.7 or 7 according to your spec.
Now to implement the code as you described,
one simple way would be to create a state machine , check the example "State Machine Fundamentals"
In your case you will have
Init State - Setup then goes to Idle
Idle - Wait for user intervention.
Start - Begin generating waveform and then Wait for STOP
Stop - > Goes back to Idle
Quit - Stops the program.
A more "sophisticated approach would be Queue Message Handler.
06-28-2023 02:01 PM
Thanks LVninja!
I will do what I can and let you know.
06-29-2023 09:49 AM
If you haven't seen before, check this https://www.ni.com/en-us/support/documentation/supplemental/16/simple-state-machine-template-documen...