Jump to content

DINT in compare over ethernet IP won't set coil


taygroebs

Recommended Posts

We are pulling in an INT32, along with REALS and other bits, over ethernet/ip coming from a camera. For some reason, when the compare is true, it will not activate the coil after. In the same routine we are storing REALs and other bits from the same device and they are working, but I can't get anything to happen with the INT32s. I have tried storing them into new tags, I've tried Num to Bits, I've tried comparing with another INT32 tag, INT to Real, and nothing has been working. I have some examples of what we have tried in the images below. You can see how the equal is true but the coil is not on. This is the only place where this coil is used. 

 

Any ideas?

 

Thank you

image.png.7fe52e7a63c99d3cfc6d0695e7efe68c.png

image.png.fa2aabf81756182b6e43f0ab29ea1c5e.png

image.png.b92fcc3a43f95462954a299e50f20459.png

Link to comment
Share on other sites

The subroutine is definitely being called in the program. In the same subroutine we are using REALs and bits from the same device and they are all working. This is the only rung that isn't working.
 

I also put the rungs in the main routine and the same thing happens

Edited by taygroebs
Link to comment
Share on other sites

1 minute ago, kratmel said:

It is possible Tag is used for Button on screen  -  it can not be active in ladder.

I appreciate the response. Unfortunately I just made the tag for my troubleshooting and it is not used anywhere else. I have made a lot of new tags for troubleshooting, arrays and DINTs and nothing has worked. 

Link to comment
Share on other sites

  • MVP 2023

I don't use Unistream but my 2 cents worth...

You might already be doing this by the look of things, but if you manually  apply the number with the camera input disabled, does it work?

If not, are you absolutely sure the coil is not being used elsewhere?  It reeks of something further down the ladder changing it's state.  Maybe put in a jump past various length ladderwork to test this theory.

cheers, Aus

Link to comment
Share on other sites

  • MVP 2023

If other parts of the code of similar content without the network variable work, then I think that it is just that variable that is pulsating.

It is updated very quickly and the condition that should be fulfilled simply "does not see" it.

I suggest you "remember" this variable via SET Coil (Part There is Direct Coil now) and see if it works.

Link to comment
Share on other sites

I also already tried using set contacts because I thought of the same thing. I also assure you that these tags are not used anywhere else and that I just created them! I have now learned that the Equals and Not Equal comparisons are swapped backwards? When the equal is true, it's not on but when it's false it is on. And the opposite is true for the not equal.

 

image.png.9aaf0c9498c28626db2e6a0d17730f4f.png

image.png.23a8e03d40bdf6e82231ce4c454085cb.png

Link to comment
Share on other sites

  • MVP 2023
On 11/7/2022 at 4:04 PM, taygroebs said:

I have now learned that the Equals and Not Equal comparisons are swapped backwards?

I guarantee you this is not the case. Test it with constants and you will see.

 

On 11/7/2022 at 3:32 PM, kratmel said:

If other parts of the code of similar content without the network variable work, then I think that it is just that variable that is pulsating.

It is updated very quickly and the condition that should be fulfilled simply "does not see" it.

This is your answer in all likelihood. Place an INC function after the compare to get additional data for troubleshooting.

Link to comment
Share on other sites

16 hours ago, Flex727 said:

I guarantee you this is not the case. Test it with constants and you will see.

 

This is your answer in all likelihood. Place an INC function after the compare to get additional data for troubleshooting.

 

I guarantee you this was the case for these specific DINTs. It wasn't doing it for any other DINTs, just the ones from the camera. You can see in my snippets. Those were brand new tags that were not used anywhere else. I used set coils as well and they were behaving the same so they were not pulsating. 

 

We ended up changing the data type within our camera and the EDS file to an UINT8. When we did this everything worked as expected. No idea why Unilogic did not like the DINTs from this camera. I will say this issue is resolved. 

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...