LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost

I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost
0 Kudos
Message 1 of 10
(3,531 Views)
You need to wire a timeout value (default is -1, which means no timeout) for reading 512 bytes. If your EEPROM generates only few bytes every time and serial read does not have time out value, your system will be lost if it expects some feedback because your serial read never returns.

Joe
0 Kudos
Message 2 of 10
(3,531 Views)
How do you tell your microprocessor how many byte that you want to read? If it is only 1 byte for how many bytes that you want to read then the maximum number you could read would be 255. Try reading more 255 or 256 bytes and see what happens. Is 255/256 the break point? you may have to read in 2 operations to get more than 255 at a time.

Rob
0 Kudos
Message 3 of 10
(3,531 Views)

Hi Deeply Annoyed,

Please post your code or an image of same.

We a pretty good about getting issues like this nailed if we have visual aides.

Otherwise we have to continue the guessing.

Re: Timeout
I think Joe was talking about the "Timeout" for the serial read, not a wait timer.

Like I said, post code.

Trying to help (without annoying you),

Ben


Ben Rayner
Certified LabVIEW Developer
www.DSAutomation.com

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 10
(3,531 Views)
Hello,

Can you elaborate what you mean by the system is lost?

Ben has suggested a good idea of posting the code in question. It would also be helpful to know which version of LabVIEW you are using and which serial VIs you are using. His clarification of the timeout for the serial read is also a good suggestion.

You mention that you have a 100ms wait statement. Is this in-between when you write the command and read the response? Sometimes the hardware needs a small amount of time to respond to the command. Putting a small delay between writing the command and reading the response allows the instrument to respond. If you have this wait statement here already, try increasing the wait time.

Another option is to add a call to the "VISA Bytes at Serial Po
rt" property node. This will allow you to check if data has been returned from the device yet or if there is an error with the command you sent.

Try incrementing the wait time before reading a response and checking how many bytes are at the serial port. If they do not fix the problem, please post all or a portion of your code so we can get a better idea of the problem.

Grant M.
National Instruments
0 Kudos
Message 7 of 10
(3,531 Views)
I've tried a large number of iterations. Recently I've used NI's simple serial communication labview 6.1 version vi. I receive a error 107... and it times out. I send a "b" string to the microprocessor, read and wait....
0 Kudos
Message 8 of 10
(3,531 Views)
I would check the instrument manual to see if there is a limit on the maximum number of bytes that it will send in one packet. Still try getting it to send 255 bytes and see if that works. If it does, then try 256 bytes to see if the limit is there (a one-byte counter for number of bytes sent). If so, then you may have to get the instrument to send data in multiple packets and put the data back together in your program.

Rob
0 Kudos
Message 9 of 10
(3,531 Views)
Hello,

You mention that you send a string to the microprocessor that tells it how many bytes to send. Instead of requesting 512 bytes, try reading 10 times and only requesting about 50 bytes at a time.

If that doesn�t help, try directly communicating with your microprocessor through HyperTerminal. If you are not on a Windows system, please let me know. Also, if you are using an NI serial board instead of your computer�s serial port, let me know.
  1. In Windows XP, go to Start, Programs, Accessories, Communications, and select HyperTerminal.

  2. Enter a name for the connection and click OK.

  3. In the next pop-up dialog, choose the COM port you are using to communicate with your device and click OK.

  4. In the final pop
    -up dialog, set the communication settings for communicating with your device.

  5. Type the same commands you sent through LabVIEW and observe if you can receive the first 54 bytes you mention. Also observe if data is returned from your 512 byte request or if HyperTerminal just waits.

If you do not receive the 512 byte request through HyperTerminal, your microprocessor is unable to communicate with your computer at a low level. LabVIEW uses the same Windows DLLs as HyperTerminal for serial communication. Double check the instrument user manual for any additional information that may be necessary to communicate.

Please let me know the results from the above test in HyperTerminal. We can then proceed from there.

Grant M.
National Instruments
0 Kudos
Message 10 of 10
(3,531 Views)