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

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
98
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
69
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
142
Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
959
I am trying to communicate between a 1769-L16 and a beckhoff EL6652 EtherNet/IP-Master. I need 8 INT and 2 REALS. When I generate the eds file, in...
Replies
1
Views
162
Back
Top Bottom