03-05-2014 03:45 AM
I am communicating with the AT Trainer 5000 via serial port to USB converter.
I installed all drivers of converter successfully and it is shown in MAX as com port. I also installed VISA software.
I am using labview 2013 version.
When I connect the hardware to PC via usb to serial converter, try to run the program for seeing of real time graphs, I am receiving this error Error 1 occurred at Scan From String (arg 1) whereas there is no waveform shown in waveform chart.
Also read buffer didn't show an incoming data at read buffer.
Other details for this error is
Possible reason(s):
LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
Also pics of error is:
Program is also attached. Please checked the also.
Expert please help me how to get rid of this error.
03-05-2014 09:33 AM
Since you are using the termination character, you should not use the Bytes At Port property node. Just set the number of bytes to read for the VISA Read to something really high (larger than what you expect in a single transmission). The VISA Read will stop reading once the termination character is reached.
Now, what is the format of the data coming from the instrument? I see you are converting an ASCII Hex string into a number while trying to also turn it into a double. That is likely why you are getting your error.
03-05-2014 09:41 AM
03-05-2014 09:59 AM
Thanks for replying to me.
The data coming from instrument is in HEX ASCII.
I am using byte at port because I want to see what is actually the format of data and what kind of data is coming from instrument.
Termination character that I put is 0x0A.
When I connected the hardware that I made myself, it connect successfully with PC and all drivers were installed successfully and MAX recognized the COM Part correctly.
But When I run the program, the error shows from scan the string that I discussed earlier. Whereas there is no waveform was showing at waveform chart and read buffer didn't show any incoming data at port.
03-05-2014 10:08 AM
I checked at hyperterminal, data is coming correctly.
There is error come at scan from string, when I run the program
03-05-2014 10:22 AM
Haris115 wrote:The data coming from instrument is in HEX ASCII.
And that is your problem with the Scan From String. It is trying to scan for floating point number (in ASCII). Since your data is coming in ASCII HEX, you need to tell the Scan From String to look for a Hex string. Use %x for the format to the Scan From String.
03-05-2014 10:25 AM
03-05-2014 10:36 AM
Then what you would recomend alternate of scan from string.
Now I change the scan string to scan hexadecimal integar.
03-05-2014 10:38 AM
Then what you would recommend alternate of scan from string.
Now I change the scan string to scan hexadecimal integer.