From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use a shared variable to communicate an error cluster?

I have a RT target that's doing DAQ. If it gets an error doing the DAQmx read, I want to get this error to the front panel VI running on the host PC. I figured this would be easy -- I created a SV using the error cluster.ctl (from C:\Program Files\National Instruments\LabVIEW 8.5\vi.lib\errclust.lib) as the type and it let me wire error lines to and from the SV. But when the host reads it, the SV says there is no error when I know there was an error (I put a probe on it right before the SV write). Is there something special about error clusters that I should know about? Or am I not using the correct ctl def?
0 Kudos
Message 1 of 5
(2,703 Views)

Hi knicewar,

you have to set the error cluster as value. I think you now only connect the error terminals of the shared variable, but this is not for data transfer. I'm not sure if you can use a cluster as transfer type (and i can't check it at the moment), but you can use a string. Use the "Flatten to string" function to create a string of your data and connect it to the value input of the shared variable.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 5
(2,679 Views)

Yes, I am sending the error wire to the SV value terminal, not the error input terminal for the SV.

 

I've used clusters before for a SV, but only a type (ctl file) that I created and only for a non-net SV.

 

I tried a variant type but that kept giving me an error trying to typecast it back to an error.  I can try the string flattening thing.  It just seems so round-about ...

 

0 Kudos
Message 3 of 5
(2,662 Views)
Have you checked the error out terminal from your shared variable when you read it to make sure there isn't an error occuring in the shared variable node?  Also, is it possible that the loop that writes the shared variable is updating the same variable again with "No Error" too fast for the receiving side to see it?
0 Kudos
Message 4 of 5
(2,653 Views)

Yes, I've checked the error out when I read and it's fine.

 

When I write to the SV, I only write when there is an error (to "latch" the last error), so I'm sure it's not getting overwritten.

 

0 Kudos
Message 5 of 5
(2,650 Views)