- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear forum members,
I've got an assembly file where i'm using two different cilinders. They are replacing each other with use of some iLogic coding.
Now i want the customer to fill in a value for the stroke of the cilinder so that the cilinder moves to this position.
So in the coding i use values for the maximum and minimum stroke and some messageboxes.
SyntaxEditor Code Snippet
Parameter("24AU034:1", "Stroke") = Stroke_assy If Height = "< 3900 mm" And Stroke_assy < 0 Then Stroke_assy = 0 mm MessageBox.Show("Enter a value higher then 0", "Wrong value",Ok) MessageBox.Show("Value set to 0", "Wrong value",Ok) ElseIf Height = "< 3900 mm" And Stroke_assy > 1600 Then Stroke_assy = 1600 mm MessageBox.Show("Enter a value lower then 1600 mm", "Wrong value",Ok) MessageBox.Show("Value set to 1600 mm", "Wrong value",Ok) ElseIf Height = "=> 3900 mm" And Stroke_assy < 0 Then Stroke_assy = 0 mm MessageBox.Show("Enter a value higher then 0 mm", "Wrong value",Ok) MessageBox.Show("Value set to 0 mm", "Wrong value",Ok) ElseIf Height = "=> 3900 mm" And Stroke_assy > 1900 Then Stroke_assy = 1900 mm MessageBox.Show("Enter a Value lower then 1900 mm", "Wrong value",Ok) MessageBox.Show("Value set to 1900 mm", "Wrong value",Ok) End If iLogicVb.UpdateWhenDone = True
So I hioe I could make it a little bit clear.
Dependable on the Height (parameter) a cilinder is chosen.
This will be the cilinder with a stroke of 1600 mm or the cilinder with a stroke of 1900 mm.
So the borders for both cilinders are:
Cilinder 1600 mm = 0 mm/1600 mm
Cilinder 1900 mm = 0 mm/1900 mm
When a value is entered that is higher or lower then these numbers there should be an error message.
Until this point it went allright.
But after a wrong value is entered, the cilinder still moves to that wrong number.
So I thought i could set the value of Stroke_assy to 0 mm or 1600/1900 mm after a wrong value is entered.
But till now i didn't manage to do that with the code i have now.
What did i do wrong?
Solved! Go to Solution.