LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bytes at Port problem on OS X

I'm seeing a problem with the number returned by the property node (of a VISA serial port) value Bytes at Port, only on Macintosh OS X (it works fine on Windows).

I'm expecting a reply packet of length 6 from the external device. Indeed, if I write some C code and check, I see 6 bytes waiting, and if I read all available bytes, I get six bytes. (There is no doubt that the device is in fact returning 6 bytes--it's "our" device.)

The property node value Bytes at Port reads 7. If I try to read 7 bytes (VISA Read), I get only 6 bytes and an error code (time out, from waiting for the 7th byte). If I attempt to read 6 bytes, I get the 6 bytes, with an OK, but a warning code that there may be more bytes available (VISA Read must be comparing the Bytes at Port internally, because it appears that there are in fact no additional bytes available).

It appears clear that the Bytes at Port value is off by 1. On the PC, the same LabView code sees 6 bytes waiting, so for now we are working around it by subtracting 1 from the Byte at Port value if we're running on Mac.

Comments?
0 Kudos
Message 1 of 19
(4,827 Views)
I should add: This is running on a PowerMac G5 Quad, latest OS X, LabView 8.2.1
0 Kudos
Message 2 of 19
(4,819 Views)
Can you post the VI you are using? I will try it on my Dual G5 with Keyspan and Belkin adapters to see what happens.

Lynn
0 Kudos
Message 3 of 19
(4,809 Views)
Thanks Lynn. Here's a test vi that shows the problem--it's just one of the LabView examples, edited for hex input and display. I've attached a screen shot of the panel after it times out, showing 7 "Bytes at Port", but only 6 returned (you can also see that the packet returned by the device announced that it had a length of 6). I've also attach a shot of the block diagram--just the important parts.

Nigel
0 Kudos
Message 4 of 19
(4,795 Views)
Why didn't the attachments stick to the message? Maybe because I previewed? One more try:
Download All
0 Kudos
Message 5 of 19
(4,793 Views)
Nigel,

Previewing disconnects attachments.

I do not have the serial port adapters here. I will run the VI tonight and let you knnow tomorrow what I see.

For some reason your VI seems to be designated as a .txt file even though the .txt suffix does not show. Deleting that allowed me to open it.

Lynn
0 Kudos
Message 6 of 19
(4,788 Views)
I did not get a chance to test last night. I will try again as soon as I can.

Lynn
0 Kudos
Message 7 of 19
(4,774 Views)
OK, thx. I'm going to try this on my Macbook Pro too...
0 Kudos
Message 8 of 19
(4,745 Views)
>OK, thx. I'm going to try this on my Macbook Pro too...

BTW, it's the same on the Macbook Pro (intel), so I have to assume it's simply a bug on the Mac implementation of LabView. Since the response I'm looking for is always the same (6 bytes), I work around the problem by just reading that many bytes on both PC and Mac despite the Mac thinking there is one more. As I said, the Mac will return a warning that there may be additional bytes available, but I ignore warnings.
0 Kudos
Message 9 of 19
(4,601 Views)
Hi,
 
What serial hardware are you using to communicate with your instrument and what is the part number? 
What version of VISA and Serial drivers are installed?

Regards,
Andy L.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 19
(4,579 Views)