plcpeople / nodeS7

Node.JS library for communication to Siemens S7 PLCs
MIT License
358 stars 121 forks source link

Cannot Read DB155.DBD332,FLOAT type on S7 1200 #67

Closed ptertrung closed 5 years ago

ptertrung commented 5 years ago

Hi plcpeople I tried read data from PLC S7 1200. But I can't read data with data type float from PLC. DB155.DBD332,FLOAT0 DB155.DBD332,FLOAT0.0 with no success.

could you tell me what the type of float is?

Lichtjaeger commented 5 years ago

This is a list of the types and their aliases that are implemented in this library:

REAL
DWORD
DINT
INT
WORD
X
B
BYTE
S
STRING
C
CHAR
TIMER
COUNTER

There is no FLOAT. You are looking for REAL.

plcpeople commented 5 years ago

I am going to close the issue. Thanks for pointing out that REAL is the correct syntax. DB155,REAL332 is a single floating point at offset 332. DB155,REAL332.10 is an array of 10 values starting at this same offset. Very similar examples are in the README.