Jump to content

Reset TYPE bit


AjaS

Recommended Posts

Hi all,

 I have button on the screen. When touched, one out of many actions is to set certain bit high in logic to enable rung (if button is not touched, the rung does not perform anything).  The rung works nice and perform everything as expected, except for the enable bit stays 'set'. The function 'reset bit' is only for integers. I do not want to use entire integer to enable/disable rung. If used integer to enable rung, the action from HMI can be increment/decrement only, therefore I would have to put  there two conditions :equal-less 0  then store 0 and equal-greater 1 as conditions then store 1, to actually stay  in 0-1 range.

Or is it possible to access integers that are used for data types 'bit', then I could use the premade function reset bit (in integer) like mask byte in assembler.

Does anyone have any better idea how to do it, please?

Thanks

Link to comment
Share on other sites

There is button on HMI having two states:0 enable, 1 disable depending on current state of the device. (If text window says 'Device enabled', the button says 'Disable' that's why 'Disable' correspond to 1 as current state of the device). This button regardless of its status trigger high UserInput if pressed to power the rung. The second action of this HMI button when it is pressed, is to set x high if button says enable, then store 1 or reset x if push button says disable and store 0. Then compare current state of the device with  user input. If they are different, write to table (the condition not equal is probably unnecessary).

image.png

Link to comment
Share on other sites

I'm confused is the button action linked to triggering UserInput? or RangeCheckDone??   and what does the action collection for the button look like(do you have more than one??)

If the UserInput is the HMI button it more than likely should be a postive transition contact so that it only executes once on the rising edge no matter how long the button is held.

 

 

here's an example from a different program we did.

image.png.3881fb9f38c800f3d1aa7e318692a54e.png

image.png.699241d6550b0265c9b023518036eda2.png

image.png.b329ebccdb650485503b184e2ddffd15.png

 

Ignore the image below it won't let me remove it from the post.

 

 

 

image.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...