Page 1 of 1

ENGINE Start switches script

Posted: Thu Feb 18, 2021 9:30 am
by mvr1918
You need to find these values yourself and then use these values in the script (by using SIOC_Monitor and move the servo arms)

Example:

ENG_Left Switch ? Start of free sone GRD to OFF kickback in
Value in SIOC Monitor 305 876

ENG_Right Switch ? Start of free sone GRD to OFF kickback in
Value in SIOC Monitor 275 819




ENG1:
The position between 305 and 875 is the free zone where you can freely move the switch from OFF to GRD
Position 876 is where the switch auto moves from GRD to OFF
Positions above 876 -1024 will not let you move the switch from OFF to GRD


A correct script for ENG1 with the values above should be

Var 0126, name ENG1_Servo, Link USB_SERVOS, Device 37, Output 6, PosL 20, PosC 512, PosR 1000

Var 1220, name ENG1_ST_SW_POS, static // servo arm is set to free, value 350
{
IF &sENG1_S_GRD = 1
{
IF &ENG1_ST_SW_POS = 1 // if in GRD and receive OFF from ngx
{
&ENG1_Servo = 900 // Auto off phase I to trigger servo arm to go from GRD to OFF ( needs to be above kickback value)
&ENG1_Servo = DELAY 350 ,200 // Auto off phase II should reset to free zones
}
}
}

Hope this clarifies thing

Re: ENGINE Start switches script

Posted: Fri Mar 03, 2023 12:47 am
by James Curry
I just wanted to share some of my experiences of the start switches that add to the above.
The start switches I had originally bought were solenoid and I could not get on with the relay card and programming so made some servo holders and adapted the units to use servos to control them.

My servos kick the starter from GND to OFF at about 650 units
The problem that I have continually had was that regardless of the coding, the servos would often reside unpowered state at totally random positions / neutral from when I power the PC on etc........

To correct this I had initiated an if condition of setting the servo at a set position of 200 units so that the servo arm will move back and clear the starter switch once the start switch is moved past the OFF position.
In effect to move the starter switch to GND you have to go past OFF anyway, so I use moving the starter to off to initiate a servo position of 200 units which moves the servo arm back to a point where the start switch will clear the GND position.

Below is what it looks like in code.
I hope this helps anyone who is having issues with initial start up positions not playing ball. I'm using the servoplus cards and not the initial smaller servo cards.
Screenshot (4).png
Screenshot (4).png (31.56 KiB) Viewed 3691 times

Re: ENGINE Start switches script

Posted: Fri Mar 03, 2023 1:40 pm
by mvr1918
Thanks for you info.

Always good to have some user that share their experience and script codes.

Re: ENGINE Start switches script

Posted: Sun Aug 18, 2024 12:36 am
by biggstuff
Can some one break this script into "plain english" for me.
I have spent the last day trying to place the {} and it won't compile because I am not script savvy.
Please copy and paste your section of the code so I can copy and past LOL
Thx

Re: ENGINE Start switches script

Posted: Mon Aug 19, 2024 9:34 am
by mvr1918
The explonation and code are already in this topic thread if you look a few topic message up.

What is the problem whith that?

Re: ENGINE Start switches script

Posted: Sun Sep 15, 2024 1:29 am
by biggstuff
Found out the hard way that the number immediately after the DELAY is the servo number and the one after the comma is the actual delay in 100th of a second.
I flipped flopped those numbers when I wanted a delay of 800 (8secs) and turned out to be the servo position which was inhibiting GND position after the auto release from the servo at 600 units.
Interestingly I have implimented some delays for the annunciators from this forum in which the (secs) is the second number.
Not script savvy!!!