02-28-2012 02:27 PM
Alright, this is probably some seriously easy stuff, but I am not that great with LabView.
To be short, my project is an HMI that interfaces with an Xbee attached via USB. I have the Xbee recognized using VISAs and I am even able to send at least one AT command to it (+++) and get predictable results. However what I do not understand is why my while loop executes at about one interation per 10 seconds........ it is unbearably slow and I don't really understand why. Also when I press my Stop button nothing happens.. it not only will not exit the loop but turns my cursor to probe mode.. I have no idea what's going on. Hopefully someone can help.
I have attached the file.
Thank you!
02-28-2012 02:39 PM - edited 02-28-2012 03:13 PM
02-28-2012 02:40 PM
Other thing , you should use shift register to pass VI reference in while loop.
02-28-2012 02:41 PM
@puneet K wrote:
Other thing , you should use shift register to pass VI reference in while loop.
That does not make any difference here.
02-28-2012 03:11 PM - edited 02-28-2012 03:16 PM
Thanks for the reply.
Possible reason(s):
VISA: (Hex 0xBFFF0011) Insufficient location information or the device or resource is not present in the system.
I'm assuming it's a general error and not something anyone else can really help me with though. 
I added a wait time, but even still, when I select my Xbee device for the VISA device, it only goes through the loop once every 5-6 seconds........
02-28-2012 03:15 PM - edited 02-28-2012 03:18 PM
Take a peek at the shipping example VISA Serial Read -Write. With RS-232 devices there is usually some way to determine when a "packet" is completed. There are several popular methods:
Hardware Handshaking: There are a few flavors but each uses signal lines that are not the ones that carry data to establish when its ok to send data and when data is available. This used to be used more frequently than it is today and is more usefull in schemes where one sender has data once in a while and the reciever does not want to poll the device unless it sees a "Request to send." Modern computors and modern communication schemes are obsoleting the need for this.
XON/XOFF: The Reciever sends an XOFF charater to the transmitter when its recieve buffer is nearly full and the transmitter shuts up while the reciever processes its buffer. Again, modern computors and modern communication schemes are obsoleting the need for this.
Termination characters: The sending device sends a special charater at the end of every message (often a linefeed ASCII 0x0A) To implement this you need to make sure that your message does not contain that letter- You would be surprised how often you want to transfer raw ADC counts 0x00-0xFF rather than scaled readings (10.234e+5) takes 9 times as long to send.
VISA handles each of these and can automatically detect a read "End" and return your data right away. Otherwise, VISA read will return when the number of characters you ask for is read OR when the timeout expires. The default timeout is 10 seconds you never read 1024 characters.
Message Based flow is also popular and works by the sender always sending the packet length at the start of a message. There is no standard on this so VISA cannot implement it. Digi-International uses this a lot.
02-28-2012 03:30 PM
Sorry, Jeff·þ·Bohrer, kind of confused. Are you saying these are things I need to implement or are already implemented within the VISAs?
02-28-2012 03:33 PM
In this concern FOR loop are the real issue because they can execute 0 times resulting in output tunnels being set to the default value for the datatype. In that situation you can lose the contents of references and error clusters (two common things that pass through loops). WHILE loops on the other hand always execute at least once so (assuming everything is written correctly inside the loop) the output tunnels should always be valid.
Mike...
02-28-2012 03:56 PM
@Mike????? did you cross-post a reply?
Fernian,
Sorry If I was unclear. I attempted to gloss over the various VISA Serial properties, how they work and how the VISA read is effected. (And why your loop time is 10 seconds)
You are not usuing the correct VISA configuration
Looking here we see that the XBEE Pro module is using a VCP through a FTDI chipset into a UART that requieres hardare handshaking using RTS/CTS. Drop a VISA Configure serial port in the front to set the flow control
02-28-2012 04:29 PM - edited 02-28-2012 04:30 PM
According to Digi's XCTU program to configure the Xbee modems, the flow rate is set to none anyhow. But I changed it to Hardware (only other option being XON/XOFF). I added the VISA Configure serial port in front of the Visa Open (is this redundant?) and set its flow to RTS/CTS. Soon I will be trying to send a command to another Xbee via Labview. I'm sure I'll be back for more.
And my final question for now was, what is controlling that 10 second loop? The Xbee chip or a VISA setting?