Andrea Ascani

MrPLC Member
  • Content count

    8
  • Joined

  • Last visited

Everything posted by Andrea Ascani

  1. Axis with inverter and encoder

    thanks everyboby for your help!
  2. Hi, I have to implement an axis control in a NX1P2 PLC using an inverter (3G3MX2) and an encoder cabled on a EC0122 board. I found something similar implemented  on a CJ2M PLC, but I have no idea how to set up the axis in the configuration of sysmac studio and how to implement the control. Can someone help me? Some sample to catch out the configuration?   Thanks a lot Andrea
  3. Axis with inverter and encoder

    Yes, the idea is to adjust frequency output of the VFD according to the position of the encoder. The axis I would like to control in this way is just a positioning Axis, with not high requests on precision. 
  4. Good morning guys,  in your experience what is the best way to syncrhonize a motor controlled in speed with an inverter and a motor controlled in position with a servo drive? Let me explaine better what is my situation: I have a belt running normally at a certain constant speed. in some moments, I would like to syncrhonize the speed according to an axis controlled from a servo. the command of a servo specific position target and of course speed and acceleration e deceleration rate. I would like to adjust the belt speed in way to follow as accurately as possible the servo movement. Thanks a lot Andrea    
  5. sequences programming in ladder

    Thanks a lot guys, I probably found a good compromise beetween your suggestion and my needing. I created an enumerated structured, naming the steps as "start(0)", "verifyingConditions(10)", "preparingOperations(20)", and so on. Then I created a structure where I move a variable of this enumerated type from a state to another according to the specific conditions. In this way I can use the name of the enumrated structure to keep the code, and change just the enumerated definition if I want to add some intermediate steps (adding the name and shifting the enum values (ie add prePreparingOperations(20) and shift the others of 10 -> preparingOperations(30)). With this solution I can also create some FB to verify if the step is > or < of a state of the enumerated list (calling by name). That was for me the fundamental part. I just found that is not possible to use comparison functions (except for = and "<>") for enum variables (even if they are INT, after all), but I solved it using EnumToNum function.
  6. Hi guys, I'm new in the forum and I'm quite new also in Sysmac programming, in ladder programming at all, to be honest.   I have some years of experience in programming CNC machines using C, on a owner platform. most of the functions I was using there were developed using "step sequences order". I mean, I had functions continuosly running where I was able to control the steps,  using the switch/case contstruct, and pass to a step to another just changing the reference variable. To be more clear, something like this:   functionStep = 0; switch (functionStep)   case 0:        if !(somethingToDoHereIsDone())                      break;       functionStep = 10;   case 10: .... and so on.   In the Sysmac programs I was able to see, something like this is possible to perform using register and AryShiftReg function. but I find it's quite complicated to manage if I want to insert intermediate steps in a second moment and most of all let an external part of the program to know in which "logical step" I am in my function.   Can you suggest me, in your experience, how can a sequencial function can be defined in Sysmac?   thanks a lot for your help.            
  7. sequences programming in ladder

    Good morning guys, thanks a lot for your replies.   All those methods are interesting, but have a look at the simple state machine here represented from panic mode: If somewhere else I have a check on the state variable to identify the actual state of this logical part of the program, I will have something like IF STEP = 2 THEN, or IF STEP > 3 THEN... etc etc. How can I manage if I have to modify the state machine inserting a new state beetween step 1 and 2? the new step will become the number 2, and I have to shift all the others (2 to 3, and so on) and most of all SEARCH for all the references in the program to the old 2 state and replace with the new.. terrible to mantain. At the same time if I add the new state to an high value, I can't use anymore any control regarding the state > or < of a specific reference. I can define the status as 100, 200, etc and insert eventual middle states as 110, 120, 121, 122... but in long terms it could be always a problem. At the same time I could set some variable to identify a logical state indipendently of the state (ie, if I need to check if the state is <5, I can set a variable = 1 at the first state and = 0 at state 5, and then check the variable instead of the state. this solution is not bad, but basically why I have to introduce new variable (or variables, is possible that I have to introduce al lot of them) when I can use the state?  
  8. sequences programming in ladder

    Thanks a lot. ST as possible, but especially in this first months I have to integrate existing code, that is mostly in ladder (actually this functionality is purely in ladder, that's my question to restructure this trying to keep the other part of the software).    The state is a good idea. Another question : in my previous job, in C, I used to use defines to name the steps: #DEFINE RETRACTED 0 #DEFINE EXTENDED 10 #DEFINE RESET 20 In this way, I can keep the code more readable and most of all insert new phases just changing the defines.  And other things, I can create functions to understand where I am looking if the state is > or < of the "name" of the define.    There is something similar that I can use for? I found the Enum, but don't know if is the best option