From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-07-2020 05:02 AM
Hello Together,
for some time I was trying and searching the forum but first I don't get it and second I don't understand why.
my task:
I'm building up a Test controlled by serial and I/O Commands, NI Hardware is PCIe-8430 and PCIe-6323 with an QMH, Labview 2015.
I have an Event Loop, a Message handling Loop and a "Working Loop"
within the working loop I'd like to send the commands and read the I/O's / serial.
on the first run I initiated the serial Visa and the DAQ I/O's in a case in the Working loop and tried to store the names in a shift register:
when I try to Read/write the Serial (as well as the I/O's) in another Case within the Working loop I get an Error.
to keep this still simple, I tried to store the Names in an TypeDefCluster:
and read from those:
I get an Error as well.
the only thing that work, is initiating them BEFORE the "working Loop":
(which I'd like to avoid)
How can I initiate the Serial and I/O's within one Case in a While Loop an access them in another Case within the same While Loop?
Thanks in Advance!
Solved! Go to Solution.
05-07-2020 06:35 AM
Well, since you only included pictures of part of your code it's hard to tell. However, it looks like you have not passed the data across all cases of your case structure in your first picture. This means that you are probably putting the data in the case structure but in a subsequent case you are replacing it with default (invalid) data. This is just a guess, though, without seeing the code.
05-07-2020 06:43 AM
@WWolf78 wrote:
I see a fatal flaw in this snippet. If you look closely at the output tunnels of your case structure, they look hollow. This tells me they are set to "Use Default If Unwired". So if you did not wire the reference through a case that was ran, you will lose your reference. You NEED to wire those wires through all of your cases. Luckily, LabVIEW has a nice little feature that has been out for a long time (since LabVIEW 8.6). Right-click on the output tunnel and there is an option to "Link Input Tunnel". There is an option to have LabVIEW automatically wire any currently non-connected output tunnels to the linked input tunnel. And once the tunnels are linked, the reference will automatically be wired through for any new cases you make.
Without knowing what else is happening in your program, I would recommend you make a separate loop for each of your serial ports and another one for the DAQ task. With them separated, they are no longer interfering with each other in regards to timing. It also makes your code more modular, and therefore reusable.
05-07-2020 08:14 AM - edited 05-07-2020 09:05 AM
Hi Crossrulz,
thanks for the Tip and the solution. Now I understood, why I'm "Loosing" the name I got an Error.
in a first Test run it works.
additionally: I do initiate the Serial and the I/O's in separate loops, just for finding and logging any error which occurs thereby..
inital I wondered, why this does not work with the type def, but it's due to the same reason
I had the typedef tunnel set to "use default if unwired"