01-27-2009 10:39 AM
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????
01-28-2009 04:42 PM
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.
01-29-2009 12:54 PM - edited 01-29-2009 12:56 PM
01-30-2009 05:40 PM