Twincat and barcodereader in rs232

Rurotin

Member
Join Date
May 2010
Location
Tampere
Posts
1
Hi!

For too many days I have spent my time on this already. I have a barcodereader for serial port and I need to read barcodes with beckhoff twincat. In system manager I have created a com-port, set up speed and made it "KL6xx1" emulation as I have understood from the help, that should work fine. Barcodes which I need to read are always 13 characters long +linefeed or so.

If I understood right, I should be able to read it from data1-data16 (I setup it so that there are 16 databytes) using cntrl-byte to keep up with happenings.

Now the problem is, that I can't quite find sense in what readings I'm getting.

I want to have the barcode, at the same location on the databytes, everytime I read it, but it seems to go around a lot. I'm driving a progrmam which circulates values 3 and 1 in the cntrl-byte and if I use the scanner, when the value is 3 I get a decent information in sensible place.

Now I reset the buffers and all, with putting value of 7 in the cntrl-bit and going back to my routine, with 3, 1, 3, 1 and so on. I would stop my program when the value is 3, but then, the statusbyte won't change and I don't know when data is entered.

If I try with different routine, with just commanding it to gove me more data, it starts to give data in databyte1-databyteN. But it wont give me the whole line, it cuts it middle. And of course it won't erase data from the rest of the bytes, so I can't figure, which data is old and which is new. When I command it to give me more data, it writes it again from databyte1 to databyteN, overwriting the data it just gave me.

I'm going nuts.

Hope someone can understand what I'm trying to explain and maybe even help me with this.
 
Hello Rurotin

I've started a TwinCAT Developers Group on LinkedIn; there are now over 340 members, some of whom have heaps of Beckhoff and TwinCAT knowledge.

Please join it if you think it will be useful: http://******/96szRZ
 

Similar Topics

I am using twincat 3 to send some strings over TCP/IP. Where the server is a sensor and my PLC is the client. I noticed that the sensor didnt...
Replies
2
Views
75
I'm trying to control a device via MODBUS RTU and the ModbusRtuMasterV2_PcCOM in Twincat 3. I've configured a device with the right com port and...
Replies
7
Views
222
Hi! I am trying to run the 'SimpleSample' (https://infosys.beckhoff.com/content/1033/TF5100_TC3_NC_I/Resources/3438746891/.zip ) to understand the...
Replies
2
Views
106
I am developing a library in twincat and one of the function uses IID_ITcVnAccess_TcVnPoint2_DINT and the definition of this type is defined in...
Replies
0
Views
72
Sorry if this has been asked before, and apologies if this seems like a trivial issue, but I am new to Beckhoff and have been banging my head...
Replies
2
Views
152
Back
Top Bottom