Has anyone used this library/ function in Codesys?
I can add the library and initialize the function block but nothing happens when running the software.
The trigger is not reset, no status given, no error, no busy, …
I’ve set up a S7-read block in Node-RED just to make sure that everything is set on the Siemens-side and it works.
Hello bjornidar,
as there is no active connection in your screenshot (see xConnected), the xTrigger is probably not handled any further. Please note that the put and get function must be activated, unfortunately I can’t tell you how to do this in Note-Red. With a 1500 or 300 Siemens controller, it works for me without any problems. I would therefore first concentrate on making sure that you have an active connection.
Have you been able to write to S7 with type “REAL” (8)?
The function block “Fb_DB_ReadWrite” returns xError no matter what I try when writing to the Siemens PLC.
I’ve successfully read/ written BYTE, WORD and DWORD but for REAL-values I am only able to READ.
Does anyone have an example program with REAL-writes to a S7-PLC? I’ve now got both a S7-300 and S7-1500 on the bench for testing, and cannot get the REAL-writes to work.
have you tried to handle real as dword as in the example of the documentation tab as workaround?
Example 3: Write 2 real to DB7.DBD0 and DB7.DBD4
-wDB_Number=7
-bType=6 (handle real like dword)
-wOffset=0
-wCount=2
-xWriteDB=TRUE
The data which should be written has to be placed at the input pWriteData=adr(WriteData) (WriteData:ARRAY[0..1] OF REAL). Please use Fu_DB_REAL_WRITE_CoDeSys_TO_S7 to convert the real variable: WriteData[0]:= Fu_DB_REAL_WRITE_CoDeSys_TO_S7(myReal1) WriteData[1]:= Fu_DB_REAL_WRITE_CoDeSys_TO_S7(myReal2)