Jump to content

Recommended Posts

Posted

Hello everyone.

I have  a problem when programing for a machine system with NJ by Sysmac studio. When I need to restart the system, I need to reset some variable in the program. Before, in Mitsubishi PLC, I just need to use ZRST to reset all variable I want in once time. But I can't find any function like that in Sysmac. I must reset every variable one by one. This is so annoying and boring too,

Does any one know how to solve my problem. Thank you so much.


Posted
7 minutes ago, Michael Walsh said:

You can assign initial values to any variable in the variable table.  No code needed at all.

But that variable only reset when the power off and turn on again. The thing I want is I just need do press a button and all variables will be reset

Posted
Just now, Michael Walsh said:

You could use the inline structured text function to reset all in one instruction.

I'm sorry but I don't understand what you mean. May you give ma an example, thank you

Posted (edited)

The NJ is a much different platform than previous PLC programming that you may be used to.

If you can manage the programming time, you should go back and re-structure your variables. If a range of consecutive memory requires operations both individually and as a group, there are a few different ways to accomplish this.

Create a Union then create your variables as the Union Name. For example: 

SS_Union.jpg.07b6775f9a9f64fcbf7ee76e3b7

Another method is to create an Array of your variables. In this case all the variables would need to be the same Data Type.

SS_INT_Array.png.b477a17ce74b62e201cb40a

I haven't done much ST programming but to do as Michael suggests, right click your rung then choose "Insert Inline ST". I don't know exactly how at this moment but I'm sure you could set all your variables to FALSE or to #0 or whatever you need them to be, all in one ST box.

Edited by IO_Rack
  • Like 1
Posted
On ‎6‎/‎5‎/‎2016 at 10:21 AM, vanquangtk said:

I'm sorry but I don't understand what you mean. May you give ma an example, thank you

You can add an inline structured text block like IO_Rack mentioned and then populate it with as many lines of code to reset any variable you want.  This would need to be done if variables were not arrays or structures.  As IO_Rack also mentions, arrays or structures could be cleared with the Clear command.

hAAAAAAElFTkSuQmCC

  • Like 1
Posted
8 hours ago, Michael Walsh said:

You can add an inline structured text block like IO_Rack mentioned and then populate it with as many lines of code to reset any variable you want.  This would need to be done if variables were not arrays or structures.  As IO_Rack also mentions, arrays or structures could be cleared with the Clear command.

Thank you so much, I got it now

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...