LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using an ActiveX control, how best to respond to Receivedata callback.vi event

I have an Active X control that controls a radio modem. I can send commands & configure & connect OK using ans Event structure triggered by pushing the appropriate buttons. The Active X event Receive Packet starts occurring & I have a callback vi that sends the receive packet data to an array on the front panel. This "beacon packet" event occurs every 5 seconds. Now I send a command packet that tells the instrument connected to the radio modem to start sending it's data measurements. Now the Receive Packet event callback vi starts occurring about once a second.  I have to respond to each Receive packet event with an Acknowledge packet send command. I tried to trigger this via the execution state of the receive packet callback vi (execution state=Running), but it seems that when vi is running every second it just appears as a constant run & my Acknowledge case with while loop sending the acknowledge command just starts running constantly, all locks up & no buttons respond, have to use the Abort button to halt things.  the device connected to the radio modem still times out, it's evidently not receiving the Acknowledge in the proper time.   Maybe I should put a sequence structure around the Receive packet callback vi, would that allow an command packet to be sent after every receive or????

0 Kudos
Message 1 of 4
(2,496 Views)

Kcar,

 

Let me make sure I understand your setup:

 

1) You are communicating with a radio model in LabVIEW via an ActiveX control

2) Every 5 seconds, a "beacon packet" event occurs

3) Upon the "beacon packet" event, you send a command to the instrument to begin sending it's measurements

4) Once this command is sent, the "Receive Packet" event occurs each second

5) You send an "Acknowledge" packet in response to each "Receive Packet" event

 

Your problem:

Your VI appears to loop continuously without any timing and locks up. No buttons respond when your VI is running.

 

Is this correct? Which portions use event structures?

 

The while loop will continue to iterate as fast as all code inside of it can execute. In order to preserve processor power and control timing, it is recommended to use a Wait function or a Wait Until Next ms Multiple function inside the while loop. However, the fact that your VI locks up seems to indicate that the VI is stuck in one portion of the VI. Have you used highlight execution to see if you can isolate this location? I understand timing is important, but highlight execution may still help.

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 2 of 4
(2,471 Views)
1) I am communicating with a radio modem in LabVIEW via an ActiveX control

2) Every 5 seconds, a "beacon packet" event occurs

3) Upon the "beacon packet" event, you send a command to the instrument to begin sending it's measurements
I do this with an event loop triggered by Event button push (button labeled "Beacon Respond")

4) Once this command is sent, the "Receive Packet" event occurs each second
This shows as an array on the front panel from the event call back vi

5) You send an "Acknowledge" packet in response to each "Receive Packet" event
Right now I start this with another button push event.

I guess my main problem is how to do the "Acknowledge "command response each time the Receive Packet event occurs.
I was trying to trigger it with the event callback property execution state = running in a case, but the case always seems to be running.
I thought of trying to trigger it with an Event triggered from the Receive packet Array Property = value changed, but that does not seem to work unless the user changes the array.

Basically asking the best way to respond to the event callback vi each time it occurs. Could do it inside the callback vi, but I need to do it only after the beacon resond is done, so I would be an button input into the "receive packet" callback vi to make a case work


Message Edited by Kcar on 01-29-2009 12:56 PM
0 Kudos
Message 3 of 4
(2,455 Views)
Is this complicated code? Would you be able to post it (or at least a screen shto) so we can take a look at exactly what you are describing?
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 4 of 4
(2,432 Views)