gijzelaerr / python-snap7

A Python wrapper for the snap7 PLC communication library
http://python-snap7.readthedocs.org/
MIT License
643 stars 245 forks source link

i need to make a boolean True / false but i got stuck ...!!! #334

Closed Hussin22 closed 2 years ago

Hussin22 commented 2 years ago

hello guys

please your help i try to make an bool true on my plc but its only switch to false but wen i want to turn it to true nothing happen below my code please your help and sorry for my bad english 👍 my code :

i``` mport snap7 from snap7.util import set_string, get_string

IP = "192.168.43.87" RACK = 0 SLOT = 1 db_n = 1 startn = 0 plc = snap7.client.Client() plc.connect(IP,RACK,SLOT)

db = plc.db_read(db_n,startn,16) your_int_value = int(True) snap7.util.set_int(db, 16, your_int_value) plc.db_write(1,0,db)



this is my plc db : 

![image](https://user-images.githubusercontent.com/76669327/147162712-a35e4c85-f5f0-4551-8dce-5ef630dfb9b1.png)

please anyone to help to understand the problem 

THANKS 
Hussin22 commented 2 years ago

HERE IS THE IMAGE OF DB :

image