Script wont work

5 years 10 months ago #29532887 by Dale@handle-tech.com
option explicit
Dim xx as integer
Dim direction as integer
' run this script when forward limit switch is tripped
xx=1
'print( xx)
While getvalue(_STFLAG, 6)<1 'check reverse limit triger stay in loop until this is triggered
'xx=getvalue(_STFLAG, 5)
SetCommand(_STFLAG,5, 1) 'Set Foward Limit Flag on
end while
SetCommand(_STFLAG,5, 0) 'reset forward limit switch waiting for next trip to run script


This is not setting the Flags or reading the Flags for that matter
I have also tried to read the Values from the getvalue(_DIN, 3) but no go. What am I doing Wrong?
I program in about 7 languages and i think I have read the function syntax correctly
I have setup Din 3 as the forward limit switch
What I want is to only allow the reverse action until the reverse limit switch is reached reseting my motor for next run.
I assume the Defined constants like _STFLAG are already in the preprocessor. I noticed I don't have to #define any command files.
is there a way to set up a debugger and break at line numbers?
is there a command line somewhere I can use to check the return values of functions and variables?
There is more code here but this basic code won't work so i have stopped.

Please Log in or Create an account to join the conversation.

5 years 10 months ago - 5 years 10 months ago #29532895 by blake
Replied by blake on topic Script wont work
Dale, which motor controller do you have? I recall that we did have a firmware error that did not properly display the status flags.

That being said, part of your script wont work. The status flags can only be queried, setcommand(_STFLAG, xx) will not do anything.

Please Log in or Create an account to join the conversation.

5 years 10 months ago #29532897 by Dale@handle-tech.com
Can I read the Vale of GetValue(_DIN,3) (forward limit switch) and if i see it trips stop the motor controller from going forward until i read the getvalue(_DIN,4) reverse limit switch. the question is how do i stop the motor from going forward and allow reverse only?

Please Log in or Create an account to join the conversation.

5 years 10 months ago #29532898 by Dale@handle-tech.com
the motor controler is a MDC1460 with a Brushless DC motor

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds