Return to site

Reference Typecast in LabVIEW

(Could I have come up with a more boring title for my post?)

So I'm fairly active on the NI TestStand forums as PulidoTech.

I just spent a little time puzzling over this one:
http://forums.ni.com/t5/NI-TestStand/Howto-make-ProcessModel-calculate-TOTAL-steps-for-calling/td-p/3337064

I use similar code to figure out if there are LabVIEW VIs and projects in sequences, but I hadn't typecast to the SequenceCallModule before (in LabVIEW, though I've done it in TestStand.)

So I spent longer than I thought trying to get it working, but figured out the bug was related to this:

broken image

At least in LabVIEW 2012, using typecast to convert a TestStand Module reference to something like SequenceCallModule will crash LabVIEW. Very annoying. For some reason, using the variant to data VI to perform the typecast works just fine. I use that VI in my TestStand operator interface, so I must have figured this out in the past (or likely copied someone else's example code.)