Skip to content

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

@Hussin22

Description

@Hussin22

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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions