Jump to content

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

Share this post


Link to post
Share on other sites
1 hour ago, Gabriel Franco said:

In ladder, use RESET  COIL to reset the bit you use in HMI button

Better to use the "Release" function of the HMI button to reset the bit.

Share this post


Link to post
Share on other sites

Not if you want the action to perform only once per button press. Resetting the bit on release would keep the bit set for many cycles.

Share this post


Link to post
Share on other sites
2 hours ago, Saragani said:

Not if you want the action to perform only once per button press. Resetting the bit on release would keep the bit set for many cycles.

You're right of course, but that's what the positive transition contact is for.

Share this post


Link to post
Share on other sites
On 6/8/2019 at 1:13 AM, Gabriel Franco said:

In ladder, use RESET  COIL to reset the bit you use in HMI button

I have done this.  it became infinite reset/set status

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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...