LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with serial port reading!!

Hi guys,

I have one problem very strange. I am trying to read data from serial port. If I put com3 it works well (I fitted before in xp the serial to com3). But If I put the serial port input at com2 it didnt work!!. I tried with hyperterminal and it works perfectly at each com port 1,2,3,4,5...

But with labview application it only works if i put the input at serial por com3. Can anyone tell me why????.

I attached very sample program to see it.

Regards.

0 Kudos
Message 1 of 15
(3,251 Views)

The way you program the serial port is obsolete and antiquated even in Labview 7.1 You should use VISA. Use find example under help and search for serial.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 15
(3,248 Views)

Yes I know, but the full program is made with this old version serial port and works fine. The only problem is I only can use com3. I believe it should be any little error.

Thanks Coq!.

 

0 Kudos
Message 3 of 15
(3,230 Views)

Fonsi wrote:

 

But If I put the serial port input at com2 it didnt work!!.


What "didn't work"? Did you get an error code? If so, what is that error code?

 

The one specific problem is that due to dataflow principles the Serial Port Write that is in frame 0 can occur before you've opened the port. There is no dataflow dependency between the open and the write, so either one can occur first. My guess is that by dumb luck you used to have the open occur first, and now you get the write to occur first. 

 

As noted, the best solution is to rewrite the code using VISA directly so that you can use the error cluster to enforce data dependency, thereby eliminating such a race condition, and even eliminating your sequence structure alltogether. 

0 Kudos
Message 4 of 15
(3,225 Views)
If you open the hood on the serial ports VIs you will see that you are using VISA already. You will actually benefit from rewriting to VISA. I think the concept you are using now was left for good in Labview 4 or 5.  If you open the hood on the "Serial port init.vi" you will find out why you have problem
Message Edited by Coq rouge on 05-02-2009 04:50 PM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 15
(3,211 Views)

The old serpdrv was eliminated with 7.0 unless you manually copied the VIs and driver from an older version. Since there is a good chance that you are using VISA, I see no obvious reason why your program should only work with Com3. The compatability VIs that convert the old driver to the new should be okay. Have you tried one of the examples? At least you would get a VISA error code.

0 Kudos
Message 6 of 15
(3,205 Views)

Dennis Knutson wrote:

The old serpdrv was eliminated with 7.0 unless you manually copied the VIs and driver from an older version.


Well perhaps it was I who converted in labview 5.1.Smiley Very Happy I remember that the old system was quite clumsy written. It was very slow. But with a few trick it could be speeded up. Just by using refnums like in files and a simple C program for baud rate setting. I could use stable 115200 tranfer rates back in labview 3.1 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 15
(3,191 Views)

Hi,

I attached one capture from the error trying to read from com2. It works with hyperterminal or using the example in 7.1 serial port.

The error is -1073807360 (its the com actived in xp right now). IF i try another com in the application the error is -1073807343 (it is normal error, since the input serial is not at this com3,4,...).

 

I see, maybe I should rewrite with visa directly, but It will take certain time to change all.

Thanks.

0 Kudos
Message 8 of 15
(3,181 Views)

Ok Coq, I forgot attached file. You can see the error.

Regards.

0 Kudos
Message 9 of 15
(3,180 Views)

Hi Dennis!,

Yes, I copied the files from old vi. Yes, example visa works well, reading for any com I fit in xp. It is strange thing. With com3 works perfectly all.

–1073807360VI_ERROR_SYSTEM_ERRORUnknown system error (miscellaneous error).

Mensaje editado por Fonsi
0 Kudos
Message 10 of 15
(3,178 Views)