From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Reading Enum value in RT system, works in debug, not in deployed

I have included screen shots of an example how the enum indicator is set and the Property Node.

We are trying to use a Property Node to get the Text Value of an enum indicator, this is sent via TCP/IP to a computer that monitors and gives the RT system commands.  This worked fine in debug mode.  When we deploy the system on to the RT, sbRIO, board we just seem to get back a null string.  We know the enum is changing values as is displays the state of a classic state machine, and other indicators show the state machine is changing.

 

We have also tried:

          Referencing the enum indicator and using that in the property node

          Using just the enum indicator value and indexing into an array of strings,  We just get the text value for the array value of zero index.  This

                    also worked ok in the debug mode but not the deployed mode.

 

Any suggestions?  I have attached screen shots how we are updating the enum indicator and reading the Property Node.

0 Kudos
Message 1 of 7
(2,401 Views)

Remember that an RT app does not have a front panel and so such things as property nodes are not going to work.

Use the Format into String vi to do a direct conversion from enum to string.  This should work the same as using the enum value

to index into an array of strings.  Is your string array constant on the diagram or saved as a default FP control?

 

http://digital.ni.com/public.nsf/allkb/CB2845F7746152208625773000713E5C

0 Kudos
Message 2 of 7
(2,393 Views)

Pass the enum into the format to string vi (use %s), this will give you the string value of the enum for the current value index. 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 7
(2,390 Views)

Thanks for the replies.  I took the enum wire, converted to string, then stored in a VI that consists of while loop with shift registers, and values read out elsewhere using the same VI.

 

To answer the one question, the string array is on the diagram.

0 Kudos
Message 4 of 7
(2,374 Views)

Oops, I was a little too quick on saying I found the solution.  As stated above I converted the enum value (directly from the source) and store the text value in a VI with a while loop/shift register, this occurs within one while loop that contains a state machine.   In a second loop that responds to commands over TCP, I read the VI/shift register and send the text via TCP.   This too works great in debug mode, but when I deploy it to the sbRIO I get the first text value, but its never updated, i.e. I get the initial text value of the enum.

 

Attachments are: a screen shot where I update the VI/shift register, where I read it (yea I know pretty lame), and the VI/shift register.

 

So what am I doing wrong now?  Why does this work great in debug mode and not when deployed.  I know the state machine is changing states when running when deployed because it does stuff.  The TCP connections work also as other items are received correctly.

 

0 Kudos
Message 5 of 7
(2,360 Views)

It would be helpful to see more of the code...

0 Kudos
Message 6 of 7
(2,351 Views)

Problem solved.  It seems to reload the sbRIO with a new startup application one needs to right click the Build Specification in the Project Explorer and rebuild and deploy (or run as startup).   I was just right clicking on the VI under the sbRIO device within the Project Explorer and deploying that, then rebooting the sbRIO.  I knew something was kind of remise as I wasn't getting the reboot dialog after deploying. ( Its been a week since I deployed for the first time, my eldest's wedding in-between).  So I was never updating the startup app on the sbRIO.  This was confirmed when I changed the code to show something much different and the debug code did but the deployed code didn't.   Oh well just a half day wasted.

 

Thanks folks!

0 Kudos
Message 7 of 7
(2,346 Views)