11-22-2012 11:40 PM - edited 11-22-2012 11:44 PM
Please see the attached code screen shot . Its a VISA session trying to communicate with a CAN to BlueTooth convertor. In the area marked red, I dont read any data at all. This despite the fact the "Bytes at Port" property node reading a value of 27 ! So where are the bytes gone ?? And it is not that all the reads are like this. - in the previous state I have a query for Version no as " V<CR> " for which the VISA read is "CANgine BT Version xxxx" . I am not sure why t his read alone returns a blank always. ?? I have tried the while loop with delays from 10 to 200ms and nothing wrong with the commands also - they work as expected on Hyper Terminal. And even in this code I am able to read the number of bytes as 27. So whay dont they show up ?? Does LV2012 have a new data type : INVISIBLE ???
Solved! Go to Solution.
11-23-2012 02:07 AM
11-23-2012 02:44 AM
Yes I do have a Termination Charatcter selected and it is <CR> .
But my problem is not due to this ( or so I guess ) as the "Bytes in Read Buffer" property node shows 27 bytes or some other finite number of bytes based on the command. But why am i not able to see these in the indicator connected to the Read vi ? ( Incidentally I have also tried to read without the TermChar but still no improvement )
11-26-2012 10:03 AM
Have you checked the errror going into the read? If there is an error on the error wire the read will return immediately without reading any data.
11-26-2012 11:11 AM - edited 11-26-2012 11:12 AM
How many kudos does anyone care to wager that the device is terminating transmissions with a CRLF? leaving (of course) a LF in the buffer. subsequent reads then start with a single "blank" line and the rest of the text is hidden on a line below that is not displayed?
Try a trim whitespace function.
11-26-2012 11:45 AM
@JÞB wrote:
How many kudos does anyone care to wager that the device is terminating transmissions with a CRLF? leaving (of course) a LF in the buffer. subsequent reads then start with a single "blank" line and the rest of the text is hidden on a line below that is not displayed?
Try a trim whitespace function.
If that's true, I would change the termination character to a LF as well as using the Trim Whitespace.
11-27-2012 12:23 AM
Thanks for the tips. My device does not accept a LF as termination character.
I have tried with a white space and also checked for any errors. Still no luck . As you can see from the image below, there is 47 bytes at the Read buffer, excpet that it is hoidden from me - I still dont read it in the indicator named Read Buffer.
11-27-2012 12:33 AM
Have you tried changing the string indicator display format to look for non-printable characters? Right click on the string indicator and set the format to "\ codes display" or "Hex display". Perhaps those 47 bytes are all non-printables.
11-27-2012 05:05 AM
11-27-2012 08:30 AM
This looks like a decent tutorial on ASCII http://blob.perl.org/books/beginning-perl/3145_AppF.pdf.
I recommend that he wire an indicator on the "Return Count" connector of the VISA read. While there may be 47 bytes at the port, this indicator will show how many bytes are actually returned with the VISA Read. By his definition, "always returns blank" would show zero bytes returned from the VISA read. I don't see any way that could be happening.
Another recommendation. Put an indicator directly at the output of the VISA read. Run the VI once. Then choose Edit >> Make Current Values default. Save the VI and post it here. That way we can see what is actually being returned from his device.