05-02-2018 01:36 AM
Hi Vinay,
how can I control that 1st serial read and write has to read COM PORT 1 and 2nd serial read and write has to read COM PORT 2
By setting the correct VISA reference values…
Did you do any of those free learning resources offered for free in the header of the LabVIEW board?
05-02-2018 01:48 AM
Dear GerdW,
Did you do any of those free learning resources offered for free in the header of the LabVIEW board?
actually No. but I learnt LabVIEW basic by LabVIEW resource which I got online Basic 1 and Basic 2
plz guide me if its there any free online tutorial for labVIEW from NI
Regards,
Vinay
05-02-2018 01:59 AM
05-02-2018 04:36 PM - edited 05-02-2018 04:39 PM
hooking up four devices to four com ports and querry/receive data in parallel is easy, but I guess it depends on how "parallel" you are hoping for.
I have done this with three wattmeters that communicate with rs-232 in one of my tests.
Now in theory with the VI's set to "preallocated clone reentrant execution" these three device should be read in parallel, but they are not. They are actually read in a seemingly random order each time.
I suspect VISA is serializing the serial port access and a race condition sets the order they are read, but that's just an uneducated guess.
05-03-2018 12:21 AM
Hello GerdW,
I have done some work for parallel visa read
please have a look and let me know weather I am going good
I cant able to attaché VI because my system doesn't allow to attaché the VI so I attached VI picture
05-03-2018 01:31 AM
Hi Vinay,
you're on the right track…
Some comments:
- Don't open and close the COM ports in each iteration of your loops. Open once BEFORE the loop, close ONCE after the loop…
- You initialize the COM port to support a (default) TermChar: don't use BytesAtPort then! Just read more bytes than your largest message will need…
- As long as you use BytesAtPort you need to add an additional wait function in the loop. But using BytesAtPort is wrong anyway…
- I would suggest a larger timeout value for your COM port initialization…
- I would parse the COM port alias in a more robust way…
- Clearing the COM port buffer with each iteration usually only leads to loss of data and incomplete messages!
05-03-2018 03:15 AM
thanks for replay GredW
I have changed VI based on your suggestions and attached
I have some questions below
I would parse the COM port alias in a more robust way...
I really didn't get what alias mean. I feel its basic thing but sorry I don't know
thank you for your support
have a nice day
05-03-2018 03:26 AM
Hi Vinay,
I would parse the COM port alias in a more robust way...
Right now you find all VISA resources and convert the array into a single string.
Then you search for e.g. "COM3" in this string and use the found "COM3" again to open the VISA resource.
Why do you even search for COM3 when you use this anyway to open the port?
Why don't you handle "not found" conditions???
I have changed VI based on your suggestions
- As you don't use BytesAtPort anymore (which is good!) you don't need to put a wait function into the loop: VISARead will wait on its own when receiving messages…
- You can connect the error wire directly to the stop condition of the loop(s)!
- You don't need to clear the COM port buffer before closing the port…
05-03-2018 03:35 AM
hello GredW,
Why do you even search for COM3 when you use this anyway to open the port?
because I need different VISA read function to open specific com port. any way I using NI rs232/4 serial port device to connect so I ll connect 1st machine to port 1 and 2nd machine to port 2 so on. then com port number will be same and 1st row of visa read will read only from COM 3 and 2nd row must read from COM 4
please correct me if I am wrong
Regards, Vinay
01-24-2025 08:32 AM
@RTSLVU Hi, I'm looking for information to Yokogawa wattmeter and if I well understand maybe you use the same as I. It's an old WT230 and I have problem not to send request but to keep back query. Can you contact me about this ? Thank you to help me to solve my problem. You can contact me by MP. Rgs Vr0.