LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9264 to produce 3 phase waveforms and shown in 1 chart

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 51 of 58
(543 Views)

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!

 

 

 

0 Kudos
Message 52 of 58
(525 Views)

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)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 53 of 58
(514 Views)

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. 

 

0 Kudos
Message 54 of 58
(501 Views)

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.

0 Kudos
Message 55 of 58
(495 Views)

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. 

 

0 Kudos
Message 56 of 58
(483 Views)

Thanks LVninja!

I will do what I can and let you know.

Message 57 of 58
(478 Views)
0 Kudos
Message 58 of 58
(466 Views)