10-21-2018 07:27 PM
Hi,
I am trying to write a code to control a function generator.
Main purpose of the code is to turn on and off the output in preset timing.
(eg. 1 minute on and 5 minute off, repeating for 10 times)
To do so, I used flat sequence loop(on, wait, off, wait) inside of a for loop (repetition) and used multiple visa write to send on and off code to the instrument. However, as you can see from the picture, the wire connecting end of the for loop to outer sub-vi became broken and showing an error massage.
"you have connected two terminals of different types.."
Can anyone tell me how to fix this problem? or better way to execute this?
10-21-2018 08:11 PM
First of all, remove the flat sequence. the data flow made by the error wire will ensure the priority of execution.
Second right click on the right end of the error wire and replace with a shift register.
the visa resource, right click on it and change to index keep last value.
Benoit
10-21-2018 08:20 PM - edited 10-21-2018 08:22 PM
You see that little hollow tunnel squares on the right edge of the For loop? That means the tunnel mode is set to indexing. Indexing mode means that as the loop iterates it stores the data from each iteration into an array. In your case the next VI that the wire connects to does not accept accept an array as input.
You can click on the tunnel and change the tunnel mode to "Last value, Indexing or Concatenating" modes. Here you want "Last Value".
To better understand loops in LabVIEW, try a few LabVIEW tutorials. Here's a good one on loops - https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:labview:basics:loops_passing_data