LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do references work in events using LabVIEW 8.2 PDA?

Howdy,

I'm trying to use multiple controls for a single event in an Event Structure. I'm using the CtlRef output of the event structure and comparing it to the references for the controls themselves. This works perfectly in Windows, but it does not work at all when running on the PDA. There are no errors, all other events work, and the event itself is firing, but the reference comparison does not.

Is this a known issue, expected behavior or a new bug? I'm using Windows XP, LabVIEW 8.2, and a Dell Axim with Windows Mobile 5.0

- Greg


Download All
0 Kudos
Message 1 of 13
(15,320 Views)

This reminds me of older bugs in the event structure on the PDA where you wouldn't get some of the data from the terminals. I would suggest typecasting both references to I32 and seeing if they are actually the same number.

This also reminds me of this thread, although the problem there was different. Perhaps casting the references to a more generic class might help.

Another option would be to see if you can wire the reference into a property node and compare it from there.

The last option I can think of is using two events and doing the actual code somewhere else or in a subVI.


___________________
Try to take over the world!
0 Kudos
Message 2 of 13
(15,280 Views)
Hey TST,

Thanks for the suggestions. When I did a typecast to both buttons and the CtrlRef of the selected button, they are indeed different. They are identical in Windows, but not on the PocketPC. Its really hard to see from these screen shots, but on the mobile device, the CtrlRef's for the controls are 9-digit numbers, while the returned CtrlRef is only a 4-digit number.

Multiple events is my work around at the moment, but I'd still like to know if this is expected/known behavior or not.

B-)

Download All
0 Kudos
Message 3 of 13
(15,230 Views)

Hi there,

I built the exact same VI (attached below) as in your image, and I only got 4-digit numbers for all. Having said that, I did only have the Mobile 5.0 Emulator. Could you please post your VI so I can test it out to be sure? Thanks!

Stephanie

 

0 Kudos
Message 4 of 13
(15,057 Views)
Sure thing. I never use the emulator, so I don't know if it works or not there. 😉
0 Kudos
Message 5 of 13
(15,044 Views)

Hey there Guru -

I figured out it was because of your numeric representation. You had the numbers as I32 and the CtlRef inside the structure only uses 16 bits, and so it was only using part of the information, which is why you were seeing different values. I changed your code to have all of the refs be I16 and you can see they are all the same. Hope this helps!

Stephanie

0 Kudos
Message 6 of 13
(14,928 Views)
Thanks Stephanie!

If I typecast all of the references to I16, then the numeric values for the references are equal on my PocketPC. So, if I compare the numeric values, instead of the references themselves, then it works.

That still doesn't explain why comparing the references works in Windows, but not on the PDA. This workaround is a simple step, but I wonder why its necessary. Anyone at NI have an idea?

B-)


Download All
0 Kudos
Message 7 of 13
(14,925 Views)

It's because there's a bug. Smiley Wink I've filed this to R&D with your VI (thanks!) with reference number 4AAGC269. Thanks for finding this but I hope this is an acceptable workaround for now!

Stephanie

0 Kudos
Message 8 of 13
(14,142 Views)
The work around is totally acceptable for now. Glad I could help find a bug!

I had another issue where if the control was an array (such as an array of booleans), comparing the reference of that control would cause my program to suddenly exit. I haven't been able to investigate if further yet (out of town) but I'll play around with that when I get back.

Thanks again for your help, Stephanie!

- Greg
0 Kudos
Message 9 of 13
(14,110 Views)
Okay, I'm back in town, and I ran this simple test: When using an array as a control in an Event Structure, and you reference the control (and typecast the output, of course) the program suddenly exits on my PDA. There's no error or anything, it just simply exits (See ReferenceTestArray.vi). You can still get the reference for the array control if you're not using the event structure, as you can see in ArrayReference.vi. Again, the program works fine in Windows XP.

- Greg


Download All
0 Kudos
Message 10 of 13
(13,315 Views)