Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

How to stopped the line if numMU in other line is greater or equal

Experimenter
Experimenter

Hi,

I want to ask how to create a control to line that will stoped and start by numMU in a other line. I my case I want to stoped Line, Line1, Line 2 if numMu in Line8 is greater or equal 20 and when numMU in Line8 is smaller then 20 then Line, Line1, Line 2 worked normal. 

 

Thanks in advance for your help!

 

 

 

 

4 REPLIES 4

Re: How to stopped the line if numMU in other line is greater or equal

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

this is a typical task for a observer control

--> Tools  - Edit Observers 

select the attribute numMu and assign a method

 

this method now will be called after each change of numMU - so this is the right place to program your logic

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: How to stopped the line if numMU in other line is greater or equal

Experimenter
Experimenter

I tryed to created a method, but i am new on tecnomatix. I wrote this but it is wrong I supposed.

Re: How to stopped the line if numMU in other line is greater or equal

Phenom
Phenom

try these 2 methods:

 

init method

	
	line.exitlocked:=false
	line1.exitLocked:=false
	line2.exitLocked:=false

 

observer method for line8.numMU

--param attribute: string, oldValue, newValue: integer
--param attribute: string, oldValue: integer
param newValue: integer

if newValue >= 20  then
	line.exitlocked:=true
	line1.exitLocked:=true
	line2.exitLocked:=true
	print newValue, " OFF"
else	
	
	line.exitlocked:=false
	line1.exitLocked:=false
	line2.exitLocked:=false
	print newValue, " ON"
	end

 

Re: How to stopped the line if numMU in other line is greater or equal

Experimenter
Experimenter

Many thanks it worked.