05-02-2009 07:32 AM
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.
05-02-2009 07:41 AM
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.
05-02-2009 08:29 AM
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!.
05-02-2009 08:59 AM
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.
05-02-2009 09:43 AM - edited 05-02-2009 09:50 AM
05-02-2009 10:55 AM
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.
05-02-2009 11:35 AM
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. 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
05-02-2009 11:57 AM
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.
05-02-2009 11:58 AM
Ok Coq, I forgot attached file. You can see the error.
Regards.
05-02-2009 12:04 PM - edited 05-02-2009 12:07 PM
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.
–1073807360 | VI_ERROR_SYSTEM_ERROR | Unknown system error (miscellaneous error). |