Jump to content

Recommended Posts

Hello,

 

I have a big problem with Unitronics, I used to use C++ instead of Ladder, so main question is how to convert MB to MI.

 

For example, If I want to simulate 3 differents % states.

 

43f2f2a50bfaccce96c2d9a786198cf6o.jpg

 

I am using three switched sensors [1-0 states] as inputs. I named I1,I2,I3, each one shows differents % (25%,75%,95%) so I storage each Input into MI to increase the value from (1/0) to a number like (25,75,95) with the function power up value when I define the MIs. Finally, I storage all MI to a general MI* this last one change values to 25,75,95. and then I use this MI* to show the differents image in the display.

 

Is it correct?

 

Thanks

Link to comment
Share on other sites

Hi tonymony,

You are in Vision/VisiLogic branch of Forum.

[unitronics Support Forum: Vision, M90/91, Jazz PLC HMI Controllers]

 

There is no "big problem with Unitronics", as there is no problem at all.

 

Vision controllers does not support any C/C++ code instead of Ladder.

 

VisiLogic have Vector Functions to convert "Bits To Numeric" and "Numeric To Bits".

See Menu->Vector->"Bits To Numeric" and "Numeric To Bits".

 

Look in help how to use it.

BR.

Link to comment
Share on other sites

  • MVP 2023

I don't think tonymony was complaining about the lack of C++, but was merely explaining that he is transitioning from C++ to Ladder Logic.

 

Tonymony, the picture you posted is too small to tell if your logic will work, but the way I would do it is to simply Store Direct either the number 1. 2, or 3 into an MI depending on whether I1, I2, or I3 is on, respectively. You can then use List of Texts, or List of Images to display the information on the HMI screen. There will be more complexity if 2 or more of the inputs can be on simultaneously.

 

  I1          1               MI0     

-| |---------Store Direct--

 

  I2          2               MI0     

-| |---------Store Direct--

 

  I3          3               MI0     

-| |---------Store Direct--

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I try this things but I still have the same problem, I will show you my program,

 

The MI13 is linked with a by point picture in the HMI with 3 states,

 

ee431cbe889ee3eceea5a6888f17c285o.jpghttp://subefotos.com/ver/?ee431cbe889ee3eceea5a6888f17c285o.png

 And the subroutines is being called:

 

7f882cd2fa5456c64f45c51e0bf39888o.jpghttp://subefotos.com/ver/?7f882cd2fa5456c64f45c51e0bf39888o.png

 

I add my program anyway

 

https://drive.google.com/file/d/0B2KvxQP-uoqGTTJxQ001X1ZjM3c/view?usp=sharing

 

Thanks a lot

Link to comment
Share on other sites

  • MVP 2023

Frankly, I've never tried to place multiple subroutine calls in a single ladder rung - perhaps it works, but there is no reason to do that. Separate the calls to ALARMS, FUEL & TRANSFER SYSTEM, and POWER PLANT into separate ladder rungs. Further, when MI 0 is equal to 219, you have an ambiguous situation. When MI 0 equals 219, should MI 13 equal 0 or should it equal 1?

Link to comment
Share on other sites

Hello Tonymony,Flex

 

I think the routine calling is not the problem here.

 

In this example I suppose the controller will execute "ALARMS, then when this routine is finished execute "FUEL & TRANSFER SYSTEM", and when finished finally the routine " POWER PLANT" will be executed.

 

If you do the calls into seperate networks and use the same calling order and the condition in each networks is always true then the result would be the same??

 

Kind regards

Henny

Link to comment
Share on other sites

I changed all, but my picture does not change properly, I put a new FB for HMI "Refresh" with this one works but only one picture the rest is not refreshed.

 

I am trying to call this subroutines at the same time, but If I need to select order. First is Fuel & Transfer System and at the same time Alarms, and If I change the screen Power Plant is on at the same time that Alarms. I always need Alarms.

 

Henny, I do not know the result, because the time cycle its so sort to know, I do not know if we could check, creating an MI to storage different values in each subroutines (storage 1 in MI for Fuel & Transfer System, 2 for Power Plant and 3 Alarms), and then look which is the last storage for MI, then you can check if the last subroutine is the your last one in your ladder call.

 

I am sorry I am newbie, I have Ideas but I will try to improve my knowledge in Unitronics.

Link to comment
Share on other sites

Hello Tonymony

 

MI13 is written to in the Alarm routine and nowere else?

If so and you remove the calling of the alarmroutine then it should be possible to write manualy every value to MI13 that you want.

This can be done in Online mode by clicking on MI13 and then a box opens were you can assign a value.

When MI13 is not influenced by any logic it wil keep the value that you write to it.

 

If you are able to write manualy values to MI13 does the picture that you have attached this MI13 refresh correctly?

 

If this is all true then try to debug the logic that writes to MI13.

First restore the call to the alarm routine.

 

Now you should have the same problem as you started with so a not correct value in MI13.

 

If you then go to the alarm subroutine to the first network that stores a value to MI13 and you do a right mouse click on the left site in the collum with the network number a menu will popup that allows you to disable the network.

If you do so and download to the controller then this network can no longer affect MI13.

 

With this method you can step by step  debug your logic and see where the problem is.

 

Re enable the network is done also by right clicking on the left site in the network collumn. Afterwards downloading to the controller to take effect.

 

I suspect that the problem you have  is that instructions in network 1 for example store value x to MI13 while in a network that comes later conditions are also true and therefore value y is stored in MI13.

 

Example:

 

 

network 1

Logic is true and stores 1 into MI13

 

network 2

Logic is true and stores 2 into MI13

 

 

This means that MI13 is 2 and the logic in network 1 has in this example no influence on MI13.

 

 

I have a link to a foto image and I hope it is vissible for you.

 

 

http://s12.postimg.org/cunrb1qwd/forum.jpg

 

 

Good luck with fault tracing

 

Kind regards

Henny

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