0

changing state when a button needs to be held

mehradhqs 2 months ago in IQANdesign updated by Kerry Brock 2 months ago 1

Hello. I am a beginner in using IQAN and have some issues: 1 - I have created a finite state machine for 2 modes. I have also created some function groups for some functionalities. I want certain function groups to only run in a certain mode and be blocked in the other mode (Like a top level conditional statement). However, apparently function groups do not have the option to be blocked like signals. Is there a way around this? Also, the transition happens while the operator is holding a button (name it A). So during the transition process the operator needs to be holding button A and when the button is left midway the transition is stopped (in this phase do we need an additional state? because it is neither in mode 1 or 2). During the transition between the modes I want to lock all function groups. Finally, the transition can only occur if a certain precondition is satisfied. I cannot seem to break down this problem and do it. 2 - As a final question, I have used some sensors to measure the position of a cylinder, but when I am doing a horizontal path, I need to maintain the same y axis for my end tip of the arm. I have done the kinematic calculations and have assigned vin and the cout, but because the simulation is not in real time, I do not know whether the sensor in the next cycle measuring the position of the end tip really gives a vertical lift path or not? How can I do the simulation continuously to see if my final position at the end of each cycle really have the same y coordinate. These questions might be a bit vague but again I am a beginner and would appreciate any help. thank you in advance for the help. 

Hi, you would need to provide more detail as to what specifically you are trying to do, but generally speaking about the items you are asking about, I can provide some insight for those items:

1a- Finite State Machine(FSM)- generally speaking, you have conditions that change a FSM from one state to another.  The channel will remain in that state until another set of conditions change it to another state.  A State Machine Channel (SMC) will typically be in a non default state as long as the conditions for that state are met.  Once those conditions are no longer valid, the SMC will revert back to the default state or another state if conditions for the other state are met.

1b- Function group activation.  If you select the function group itself, there is an "Enabled" line in the properties. The default value is "Yes," that makes it enabled all the time.  You can use a digital type channel, typically an Internal Digital Channel (IDC) to enable the function group when the channel is True.  You would set the conditions to make the function group True in the IDC so that it is True when the conditions are met and therefore enable the function group.

2- Simulation, I am not understanding exactly how you want it to work, but I will assume as the cylinder extends, it should maintain the tip at a constant Y position.  If you are using one hydraulic valve to control cylinder rod length, then the mechanical linkage would control the Y position relative to the X position.  I am not sure what type of sensor you are using with the VIN channel, maybe an angle sensor, but with simulation you would generate an output value with the COUT and manually adjust the VIN value.   The simulator would not automatically change the VIN value while the COUT is active.  Hopefully this helps understanding the basics of the operation of the items you asked about.