lammertb/libfins

I need example code to write data to DM and EM.

Closed this issue · 1 comments

I know if we are going to write data to CIO register, must describe like finslib_memory_area_write_uint16(sys, "CIO100.0", addr, num) .
But if we are going to write data to DM or EM, how can we describe memory name ?
"D0.0" or "E0.0" -> Such describe was occurred error by me.
If you would provide example code, I will be happy.
Look forward to hear from you soon
Thanks

You can't write a single bit with the finslib_memory_area_write_uint16() function, only full words. D0.0 and E0.0 represent single bits.

The encoding of an address to the binary representation of a memory area in the FINS message is done through the fins_area[] array in the file src/fins_search.c. You can check this file to see which memory area prefixes are recognized for the different PLC modes.