Twincat, memcpy and type conversion

tevious

Member
Join Date
Feb 2015
Location
Balingen
Posts
22
Hello,

I need to extract some elements for a txt file.
I browse my file using ADR, pointer and have no problem for that.
When I find a element I needm I want to copy it to a variable in the PLC (it could be INT or REAL for example).

My txt file is a long array of bytes within each byte has the ascii code of the correspondant letter.

When I try to get my element, I use the following function:
memcpy(ADR(myVar),ADR(txtElementAdr),ElementLength).
I've no failure but myVar has no sense...

Could you explain me how can I proper get my text element to the typed variable?

Thanks a lot!
 

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
96
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
246
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
117
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
83
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
169
Back
Top Bottom