LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port read.vi

Solved!
Go to solution

thank you Dennis, I think i got the program to change the old serial function to the new visa function.

the new one is so much better and easier to use.

THANK YOU AGAIN FOR YOUR HELP!!!

Best regards,
Krispiekream
0 Kudos
Message 11 of 46
(2,780 Views)

okay, i am back and facing a new problem.

i switched over from old  serial driver to serial driver using VISA.

on one system my computer is faster in processor, the other is slower.

the old serial functions works fine on the slow processor, but when i replaced with the VISA version. it is causing error.

but when i put a delay time on the visa driver. i guess it allow time for the serial to be read and the error is gone. 

but i am setting the pressure on my chamber. the delay is causing the  setting pressure to be diffcult. becuase by the time the pressure hit a certain pressure, it would stop. because of the delay, it reads the pressure too late and my chamber ca't set properly. 

question 1? 

 is the old serial driver faster than the new VISA?

question 2?

replacing new processors/computer is not a good solution to this right?

 

 

 

Best regards,
Krispiekream
0 Kudos
Message 12 of 46
(2,757 Views)

I think the old driver is actually slower and that is why placing a delay works for VISA. Using the old driver, the read took just a bit longer and the instrument had time to respond.

 

There could be other things going on that I can't solve or diagnose because I don't have your setup.What kind of delay have you been using? A way to get away from fixed delays is to put a VISA Bytes at Serial Port inside a loop. Exit the loop when the number of bytes is greater than 0. A following loop has another VISA Bytes at Serial Port and the number of bytes available is wired to the VISA Read. This loop will be set to exit when the number of bytes is equal to 0. Doing this, you will start the read as soon as bytes are available and don't have to guess at the delay values.

Message 13 of 46
(2,745 Views)

hi there.

i have been trying 2 weeks now trying to solve this issue is none is working. 

i even used both called out for serial drivers OLD serial and VISA serial port for different system and i don't think thats a good solution.

do you think you can take a look at my code and show through me a diagram of what you mean by

 


" A way to get away from fixed delays is to put a VISA Bytes at Serial Port inside a loop. Exit the loop when the number of bytes is greater than 0. A following loop has another VISA Bytes at Serial Port and the number of bytes available is wired to the VISA Read. This loop will be set to exit when the number of bytes is equal to 0. Doing this, you will start the read as soon as bytes are available and don't have to guess at the delay values."

 


 

Best regards,
Krispiekream
Download All
0 Kudos
Message 14 of 46
(2,702 Views)
Solution
Accepted by topic author krispiekream

I have no way to save the VI for 7.0 but I've attached an 8.0 version and an image of what I had in mind.

 

Message Edited by Dennis Knutson on 09-26-2008 02:47 PM
Message 15 of 46
(2,693 Views)
 thank you so much,. i will try this right now and see if it works.
Best regards,
Krispiekream
0 Kudos
Message 16 of 46
(2,688 Views)

okay. it seems to be stuck here.

 

Best regards,
Krispiekream
0 Kudos
Message 17 of 46
(2,683 Views)

if i use the software that would run old serial driver for one system and visa serial for another. it seems to work okay and i don't mind using that if it must be the case. but i also run into another case where. if i am reading 730 mmgh and on my indicator. sometimes its reads 26 mmHg really quick and then back to 730. i think its  a sampling issue. do you have a suggestion for that fix?

 

Best regards,
Krispiekream
0 Kudos
Message 18 of 46
(2,670 Views)

Take a close look at the False case in Dennis' code and compare it to the False case in your code.  See any difference?

 

When bytes at port =0 is False, he reads the bytes from the port.  You do nothing in the False case and the loop runs forever because you will always have those 98 bytes at the port.Smiley Wink

Message 19 of 46
(2,651 Views)

oh, what a silly mistakes. i guess i have to come back on monday and try that again. but i thought i also tried making my case false/true and it would still not work. but yeah..i'll try it again when i come back.

you guys are great!

Best regards,
Krispiekream
0 Kudos
Message 20 of 46
(2,646 Views)