LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error while reading/writing to serial port

Hello,

I am trying to read/write to my serial port but
this message shows every time i launch the
program. Does anyone know some help ?

Thanks

FdB
0 Kudos
Message 1 of 13
(6,881 Views)

Do any of these

http://search.ni.com/nisearch/nisearchservlet?nistype=default&ddown=0&filter=%2Btaxonomy:top+%2B(met...

help?

If not, tell us a bit more about your setup.

David

Message 2 of 13
(6,868 Views)

Hi,

  what version of LabVIEW are you using?

What version of NI-VISA are you using?

Sometimes just upgrading the VISA can fix issues like this very generic one. You can get the latest version from here (licenseing permitting) :

http://digital.ni.com/softlib.nsf/websearch/78C0C40D1DDE95F8862571550050B9B1

We've also seen on the discussion forums where the instrument that's being talked to can be the cause of the problem - would it be possible to try a write, then a read, but with pins 2 and 3 (transmit and receive on an RS232 port) linked together rather than connected to your device? You should read back exactly what you transmitted then, and it removes the instrument as the cause of the problem.

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 3 of 13
(6,851 Views)
Hi !

I am using LabView 8.0 and I just downloaded (that's three days ago) the
latest version of NI-VISA. I am using the PT-104 probe by picotech and
a strange thing is that whenever I retrieve the instrument I can read and
write allright (nothing obviously) but the error message crops up when
it is plugged in. I hope that can help you getting me further. Promised, I'll
rate you as soon as the rating buttons appear again.

Fred
0 Kudos
Message 4 of 13
(6,845 Views)

Hi,

  you say "retrieve" the instrument - what do you mean - unplug it?

The PT104 from Pico-tech has got LabVIEW drivers and this may be an easier way of interfacing to it than going to the low level calls. Since the actual error only seems to appear when the device is plugged in, is the com port settings matching the settings required by the pt104 data logger?

http://www.picotech.com/drivers.html

Does the PICOlog software work OK?

http://www.picotech.com/software/beta/package/PicoFull_r5_14_4.exe

According to another discussion forum, you already have this, so do they work?? (you may need to re-install this to get the software for LV 8.0 support)/

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 5 of 13
(6,827 Views)
Hello,

sorry I ment unplug.
I managed to communicate with the PT104 through a
Pico provided VI but in order to control everything myself
I would like to go on a lower level.
The Pico Software works great (I did everything with it
until now) but I want to change for the above reasons.

Cheers,

Fred
0 Kudos
Message 6 of 13
(6,813 Views)
Hi !

thank you for your link. I took me some time to look them
all through but here I am. Basically some are much too
specific so I could not use them. I've tried to generalise
to make it useful to me but it didn't work out.

My setup is the following:

I am trying to communicate with a PT 104 serial data logger.
In its documenation it sais that "at startup" (of the logger, I
suppose) or when sending a version request (0x00 in
that case) it should reply 5 bytes that tell me different stuff
(I can check it if you want). Basically with the
"basic serial read and write" vi I manage to write my
request but in any case I never get an answer either because
of the error show above or because of a time out error.

Thanks in advance for your help.
Please tell me if you need more precisions,

Cheers,

Frederico.
0 Kudos
Message 7 of 13
(6,802 Views)

 Hi,

  what are the serial port settings you're using - do they match what the PT104 requires?

It may be that the drivers change the default serial port settings to match what they require. It's even possible that the settings change on the fly - something would have been programmed into the driver if this were the case - it's rare that manufacturers do this, however there's atleast one case of this on the discussion forums that I've seen.

If you can find those settings, then you can start dealing with the information coming back. If not, then you can't really establish correct communication.

Personally, the reason for "want to go lower level" isn't that good a reason. Needing to go lower level for speed / memory performance related issues would be, however if the driver works, then I'd recommend you just use it. If it doesn't have the features you need, then a better option would be to use the programmers reference manual for details on how to approach the communication which you're only going to get from the manufacturer of the hardware.

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 8 of 13
(6,793 Views)
Frederico
 
This VI (LV8)
 
 
1. Open the serial port at 2400 baud
2. Powers down the PT104 and wait 0.5 secs for this to settle
3. Flushes the serial power buffer to remove any power down acknowledgements in the serial buffer
4. Powers up the PT104 waits 1 sec for things to settle
5. Reads any bytes in serial rx buffer.
6. Power down the PT104
7. Close the COM Port.
 
This is a bit of a guess but this is how I would approach it. Can you try this and let us know how you get on?
 
thanks
 
David

Message Edited by David Crawford on 07-20-2006 10:31 AM

Message 9 of 13
(6,795 Views)
Hi !

In the user manual of the PT 104 the basic
answer at startup is given. It matches what
I get out of your VI. I will now try to change
it a bit to get the data out of it and store it
somewhere and I keep you posted.

Cheers, Fred
0 Kudos
Message 10 of 13
(6,780 Views)