Hi,
I read through the v24Open and v24Read functions and tested the Read script out of the Manual. Is there anyway to setup Serial Port to read Unsolicited Data? I am hoping there are more functionality other than just on-demand reading. I am working on an Application where half of our devices our PLC based machines and other half consists of Serial Port Scales, Thickness Gauges, Serial Port Instruments.
Sometimes the serial data is a single line of 10 chars with EOL char from a Scale. Some machines single line of approx. 50 Chars. Other Instruments print out 30-50 Lines of data.
If we could put the v24Read in some sort of background thread? I see that SMS libraries rely on v24, they must be handling unsolicited data somehow?. I have not dug deep enough into v24 library to see how it functions or if I can even look into how v24Read operates. Can I test the Serial Port buffer for Chars then actually do the read?
Maybe there are hidden functions of v24Read?
Examples of advanced serial port functionality(unsolicited data, readline, test buffer)
https://inductiveautomation.com/news/ne ... nstruments
https://www.teuniz.net/RS-232/
https://pyserial.readthedocs.io/en/late ... intro.html
v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc
- dano3829
- Posts:5
- Joined: Wed Feb 13, 2019 9:29 pm
v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc
If you are talking about the functions defined in the CTRL library sms.ctl you will see that a function mainloop() is defined which is using a while(1) condition with 10 seconds delay to read data and to check if a SMS was received.
Possibly you can implement an API manager or API driver which uses a v24 C++ library which supports functions to read a v24 interface.
Best Regards
Leopold Knipp
Senior Support Specialist
Possibly you can implement an API manager or API driver which uses a v24 C++ library which supports functions to read a v24 interface.
Best Regards
Leopold Knipp
Senior Support Specialist
- gschijndel
- Posts:376
- Joined: Tue Jan 15, 2019 3:12 pm
Re: v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc
To avoid blocking your script you could use a timeout of 0 seconds to get the available data.dano3829 wrote: ↑ Wed Apr 03, 2019 7:31 pmCan I test the Serial Port buffer for Chars then actually do the read?
Maybe there are hidden functions of v24Read?
There are no hidden v24 functions.