FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
04-03-2024 05:33 PM
Hello,
I'm trying to get a string from the datalayer at 'fieldbuses/modbustcp/client/devices/EFC1/info/status' which would return a drive status.
I've been using some other forum topics to make the following code :
I understood that I have to use the type written in References from Metadata, so uint16 in that case.
But I got the DL_Type_mismatch error :
Is my problem about wrong type variable type ? Or did I implement some code error ?
Thanks in advance
Solved! Go to Solution.
04-04-2024 09:14 AM - last edited on 10-01-2024 09:35 AM by CodeShepherd
Have a look to the PLC library CXA_Datalayer in the library manager of ctrlX PLC Enginnering, where description and examples are included:
This example shows how to read a node value using DL_ReadNode(). This function must only be used on simple data types! For complex types please use DL_ReadNodeValue(). To use this function correctly you need to know the type of the returned value. If you don’t know the value type, the DL_ReadNodeValue() function will provide a NodeValue-object which can be used to request the specific type.
04-04-2024 10:36 AM
Hello,
Using simply DL_ReadNode() works perfectly.
Thanks