v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc

Discussion about recent product features & solutions!
Search

Post Reply
3 posts • Page 1 of 1
dano3829
Posts: 5
Joined: Wed Feb 13, 2019 8:29 pm

v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc

Post by dano3829 » Wed Apr 03, 2019 5:31 pm

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

User avatar
leoknipp
Posts: 1819
Joined: Tue Aug 24, 2010 5:28 pm

Re: v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc

Post by leoknipp » Mon Apr 08, 2019 11:25 am

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

gschijndel
Posts: 55
Joined: Tue Jan 15, 2019 2:12 pm

Re: v24Read() Features? Unsolicited Reads, ReadLine, Test for Bytes etc

Post by gschijndel » Fri Apr 12, 2019 7:26 am

dano3829 wrote:
Wed Apr 03, 2019 5:31 pm
Can I test the Serial Port buffer for Chars then actually do the read?
Maybe there are hidden functions of v24Read?
To avoid blocking your script you could use a timeout of 0 seconds to get the available data.
There are no hidden v24 functions.

Post Reply
3 posts • Page 1 of 1