EZ-Script

EZ-Script Functions

 

Sleep (milliseconds)

·         Pauses for specified milliseconds

·         Example sleeps for 1 second: Sleep(1000)

 

SleepRandom (lowMilliSec, highMilliSec)

·         Pauses for a random millisecond delay between the 2 provided values

·         Example: SleepRandom(1000, 5000)

  

Servo (servoPort, position)

·         Move servo to the specified position

·         Servo position is between 1 and 180

·         Example: Servo(D14, 25)

 

SetServoMin (servoPort, position)

·         Set the minimum limit that this servo can ever move to

·         Servo position is between 1 and 180

·         Example: SetServoMin(D14, 40)

 

SetServoMax (servoPort, position)

·         Set the maximum limit that this servo can ever move to

·         Servo position is between 1 and 180

·         Example: SetServoMax(D14, 100)

  

PWM (digitalPort, speed)

·         Set the PWM (Pulse Width Modulation) to the desired duty percentage cycle

·         This simulates voltage on the specified pin (Between 0 and 5v)

·         PWM Value is between 0 and 100

·         Example: PWM(D14, 90)

  

GetPWM (digitalPort)

·         Gets the PWM (Pulse Width Modulation) of specified port

·         PWM is between 0 and 100

·         Example: $x = GetPWM(D14)

 

PWMRandom (digitalPort, lowSpeed, highSpeed)

·         Set the PWM (Pulse Width Modulation) to a random percentage duty cycle

·         This simulates voltage on the specified pin (Between low and high percentage value, scaled between 0 and 5 volts)

·         The value is between 0 and 100

·         Example: PWMRandom(D14, 10, 90)

  

ServoSpeed (servoPort, speed)

·         Set the speed of servo or PWM. This is the speed to move between positions.

·         The servo speed is a number between 0 (fastest) and 10 (slowest)

·         *Note: To initialize the ServoSpeed() at first use, set a Servo() position before using the ServoSpeed() command. If there is no previous position (such as during power-on), the software assumes the position is 0 and will cause issues with your robot.

·         *Note: Once the ServoSpeed() has been initialized the first time, specify the ServoSpeed() before specifying the Servo() position.

·         Example: ServoSpeed(D14, 25)

  

ServoSpeedRandom (servoPort, lowSpeed, highSpeed)

·         Set the servo speed or PWM to a random value

·         The servo speed is a number between 0 (fastest) and 10 (slowest)

·         *Note: To initialize the ServoSpeed() at first use, set a Servo() position before using the ServoSpeed() command. If there is no previous position (such as during power-on), the software assumes the position is 0 and will cause issues with your robot.

·         *Note: Once the ServoSpeed() has been initialized the first time, specify the ServoSpeed() before specifying the Servo() position.

·         Example: ServoSpeedRandom(D14, 10, 20)

  

ServoUp (servoPort, count)

·         Increment the servo position value by specified count

·         Servo position is between 1 and 180

·         Example: ServoUp(D14, 1)

  

ServoDown (servoPort, count)

·         Decrement the servo position value by specified count

·         Servo position is between 1 and 180

·         Example: ServoDown(D14, 1)

  

ServoRandom (servoPort, lowPosition, highPosition)

·         Move the servo to a random position between low and high

·         Servo position is between 1 and 180

·         Example: ServoRandom(D14, 10, 20)

  

Release (servoPort)

·         Release a servo from holding its position

·         Example: Release(D14)

 

ReleaseAll ( [boardIndex] )

·         Release all servos from holding their position

·         BoardIndex is optional, and specified the EZ-B board to use

·         Example: ReleaseAll()

 

Move (servoPort, forward/stop/reverse)

·         Set a modified servo to move

·         Example: Move(D14, “forward”)

  

Set (digitalPort, on/off/true/false)

·         Set a digital port state to either on or off

·         Example: Set(D2, OFF)

  

SetRandom (digitalPort)

·         Set a digital port to a random state of either on or off

·         Example: SetRandom(D2)

  

ToggleDigital (digitalPort )

·         Toggle the digital port

·         Example: ToggleDigital(D2)

 

Digital_Wait (digitalPort, on/off/true/false, [delay ms])

·         Wait until the digital port status has changed

·         The optional parameter Delay MS is the millisecond delay for checking. This value determines the delay between checks.

·         Example: Digital_Wait(D12, ON)

·         Example: Digital_Wait(D12, ON, 50)

  

ADC_Wait (adcPort, higher/lower/equals, value, [delay ms])

·         Wait until ADC port is higher or lower than specified value

·         The optional parameter Delay MS is the millisecond delay for checking. This value determines the delay between checks.

·         Example: ADC_Wait(ADC0, HIGHER, 50)

·         Example: ADC_Wait(ADC0, HIGHER, 50, 50)

 

ADC_Wait_Between (adcPort, low, high, [delay ms])

·         Wait (pauses script) until ADC port is between the specified values. Soon as the ADC port is between the low and high values, it will stop waiting.

·         The optional parameter Delay MS is the millisecond delay for checking. This value determines the delay between checks.

·         Example: ADC_Wait_Between(ADC0, 20, 50)

·         Example: ADC_Wait_Between(ADC0, 20, 50, 50)

 

Movement_Wait ( forward/reverse/stop/left/right )

·         Wait until a movement from the movement panel is specified.

·         Even if another script executes a movement, this will execute

·         Example: Movement_Wait(“FORWARD”)

 

Servo_Wait ( digitalPort, higher/lower/equals, value )

·         Wait until the Servo Port is higher or lower than specified value.

·         Zero can be specified as a value for a stopped servo.

·         Example: Servo_Wait(D5, HIGHER, 20)

   

WaitForServoMove (servoPort, [timeout MS])

·         Waits for the specified servo to move.

·         Unlike Servo_Wait, this function does not wait for a specific value. It simply returns once the servo has moved to a new position.

·         Optionally, the timeout parameter will stop waiting after the specified number of milliseconds.

·         Example: WaitForServoMove(d0)

·         Example: WaitForServoMove(d0, 1000)

  

Ping_Wait (triggerPort, echoPort, higher/lower/equals, distance)

·         Wait until the Ping Sensor distance is higher or lower than specified distance value.

·         Trigger and Echo are Digital Ports

·         Example: Ping_Wait(D3, D4, HIGHER, 50)

 

Forward( [speed], [milliSeconds] )

·         Using a Movement Panel Control, this will start your robot in the Forward direction.

·         Optionally, you can provide the speed and/or number of milliseconds to move.

·         You will require at least one movement panel to be configured within the project. This function will control that movement panel.

·         Speed is a number between 0 and 255

·         Example: Forward()

·         Example: Forward(200)

·         Example: Forward(255, 5000)

 

Reverse( [speed], [milliSeconds] )

·         Using a Movement Panel Control, this will start your robot in the Reverse direction.

·         Optionally, you can provide the speed and/or number of milliseconds to move.

·         You will require at least one movement panel to be configured within the project. This function will control that movement panel.

·         Speed is a number between 0 and 255

·         Example: Reverse()

·         Example: Reverse(200)

·         Example: Reverse(255, 5000)

 

Stop()

·         Using Movement Panel Control, this will stop your robot.

·         You will require at least one movement panel to be configured within the project. This function will control a movement panel.

·         Example: Stop()

 

Left( [speed], [milliSeconds] )

·         Using a Movement Panel Control, this will turn your robot left.

·         You will require at least one movement panel to be configured within the project. This function will control that movement panel.

·         Optionally, you can specify the speed and/or number of milliseconds to turn.

·         Speed is a number between 0 and 255

·         Example #1: Left()

·         Example #2: Left(200)

·         Example #2: Left(200, 5000)

 

Right( [speed], [milliSeconds] )

·         Using a Movement Panel Control, this will turn your robot right.

·         You will require at least one movement panel to be configured within the project. This function will control that movement panel.

·         Optionally, you can specify the speed and/or number of milliseconds to turn.

·         Speed is a number between 0 and 255

·         Example #1: Right()

·         Example #2: Right(200)

·         Example #2: Right(200, 5000)

 

Up( [milliSeconds] )

·         Using the servo port settings from a Movement Panel Control, this will raise your drone robot up

·         Optionally, you can specify the number of milliseconds to turn.

·         Example #1: Up()

·         Example #2: Up(1000)

 

Down( [milliSeconds] )

·         Using the servo port settings from a Movement Panel Control, this will lower your drone robot up

·         Optionally, you can specify the number of milliseconds to turn.

·         Example #1: Down()

·         Example #2: Down(1000)

 

RollRight( [milliSeconds] )

·         Using the servo port settings from a Movement Panel Control, this will roll your drone robot right

·         Optionally, you can specify the number of milliseconds to turn.

·         Example #1: RollRight()

·         Example #2: RollRight(1000)

 

RollLeft( [milliSeconds] )

·         Using the servo port settings from a Movement Panel Control, this will roll your drone robot left

·         Optionally, you can specify the number of milliseconds to turn.

·         Example #1: RollLeft()

·         Example #2: RollLeft(1000)

 

Land()

·         Tell your flying drone to land

·         Example: Land()

 

TakeOff()

·         Tell your flying drone to take off

·         Example: TakeOff()

 

DroneEmergency()

·         Tell your flying drone to reset from emergency or power down when flying.

·         This command should be added a button on the joystick so you may stop the drone so it does not get away or in danger.

 

SayEZB( text to speech, [ezb index] )

·         Speaks the text that is specified within the brackets out of the EZ-B v4 speaker in the background. This command does not block, the script will continue to execute.

·         Optionally, the EZB index to speak out can be added as the second parameter. This can be empty as well. The value is between 0 and 4.

·         Example: SayEZB("Hello, I am a robot”)

·         Example: SayEZB(Speaking out of second EZB”, 1)

 

SayEZBWait( text to speech, [ezb index] )

·         Speaks the text that is specified within the brackets out of the EZ-B v4 speaker and blocks until done speaking.

·         Optionally, the EZB index to speak out can be added as the second parameter. This can be empty as well. The value is between 0 and 4.

·         Example: SayEZBWait("Hello, I am a robot")

·         Example: SayEZBWait(Speaking out of second EZB”, 1)

 

StopEZBAudio()

·         Stops any audio background that is being streamed through the EZ-B v4

·         Example: StopEZBAudio()

 

Say( text to speech )

·         Speaks the text that is specified within the brackets out of the PC Sound Card in the background. This command does not block, the script will continue to execute.

·         Example: Say("Hello, I am a robot")

 

SayWait( text to speech )

·         Speaks the text that is specified within the brackets out of the PC Sound Card and blocks until done speaking.

·         Example: SayWait("Hello, I am a robot")

 

SpeakStop( )

·         Stops speaking the current specified phrases out of the PC Sound Card.

·         Example: SpeakStop()

 

SpeakRSS( url, [story index] )

·         Speaks the title and text of the rss url out of the PC Sound Card.

·         Example #1: SpeakRSS("http://rss.cbc.ca/lineup/world.xml")

·         Example #2: SpeakRSS("http://rss.cbc.ca/lineup/world.xml", 3)

 

SpeakRSSDescription( url, [story index] )

·         Speaks only the text of the rss url out of the PC Sound Card.

·         Example #1: SpeakRSSDescription("http://rss.cbc.ca/lineup/world.xml")

·         Example #2: SpeakRSSDescription("http://rss.cbc.ca/lineup/world.xml", 3)

 

SpeakTwitter( twitterUserName, [story index] )

·         Speaks the twitter feed for the specific username out of the PC Sound Card.

·         Example #1: SpeakTwitter("EZ_Robot")

·         Example #2: SpeakTwitter("EZ_Robot", 3)

 

SpeakVolume( value )

·         The volume of the speech synthesizer out of the PC Sound Card.

·         The value is between 0 and 100

·         Example: SpeakVolume(30)

 

I2CClockSpeed( boardIndex, rate )

·         Specify the clock speed of the i2c interface. The default speed is 100000, which is 100khz.

·         Many devices support faster speeds, up to 400000 (400khz).

·         Example: I2CClockSpeed(0, 100000)

·         Example: I2CClockSpeed(0, 400000)

 

I2CWrite( boardIndex, deviceAddress, data, .... )

·         Send a series of ASCII data to the specified device hex address over the i2c interface.

·         This command will Start i2c, Write Data, and Stop i2c.

·         boardIndex is the EZ-B you wish to use (0 is first EZ-B)

·         Device Hex Address of i2c device must be in 0x00 format.

·         Data can be Hex (0x09), string ("string"), or decimal (188)

·         Example: I2CWrite(0, 0x09, 0x02, 0x05, 0x06)

·         Example: I2CWrite(0, 0x09, 244)

·         Example: I2CWrite(0, 0x09, "This is text “ + $variable)

 

I2CWriteBinary( boardIndex, deviceAddress, variable )

·         Send a series of binary data to the specified device hex address over the i2c interface from the provided variable array.

·         This command will Start i2c, Write Data, and Stop i2c.

·         boardIndex is the EZ-B you wish to use (0 is first EZ-B)

·         Device Hex Address of i2c device must be in 0x00 format.

·         Variable is an array with data that you wish to send

·         Example: I2CWriteBinary(0, 0x09, $variable)

 

I2CRead( boardIndex, 7bitDeviceAddress, bytes to expect )

·         Returns a series of ASCII data from the specified address over the i2c interface

·         boardIndex is the EZ-B you wish to use (0 is first EZ-B)

·         Device Hex Address must be hexadecimal 7Bit (0x5e)

·         You must specify the number of Bytes To Expect

·         Example: $Val = I2CRead(0, 0x5e, 2)

 

I2CReadBinary( boardIndex, 7bitDeviceAddress, bytes to expect, variable )

·         Returns a series of binary data from the specified address over the i2c interface into the specified variable array

·         boardIndex is the EZ-B you wish to use (0 is first EZ-B)

·         Device Hex Address must be hexadecimal 7Bit (0x5e)

·         You must specify the number of Bytes To Expect

·         Example: I2CReadBinary(0, 0x5e, 2, $variable)

 

SendSerial( digitalPort, baudRate, data, ... )

·         Send a series of data over the specified port and baud rate

·         Data can be Hex (0x09), string ("string"), or decimal (188)

·         Example: SendSerial(d0, 9600, 0x00, 0x04, 0x05)

·         Example: SendSerial(d0, 9600, 244, 200, “a”)

·         Example: SendSerial(d0, 9600, "This is text")

·         Example: SendSerial(d0, 9600, “Hello “ + $name)

 

SendUDP( hostname, port, data, ... )

·         Send a series of UDP data over the specified port to the hostname

·         Data can be Hex (0x09), string ("string"), or decimal (188)

·         Example: SendUDP(“192.168.0.1”, 21, “Hello World”)

·         Example: SendUDP(“192.168.0.1”, 21, 0x20, 0x21, 0x22, 0x30)

·         Example: SendUDP(“192.168.0.1”, 21, 0x20, 0x21, 0x22, “Hello”)

·         Example: SendUDP(“192.168.0.1”, 21, 0x20, 0x21, 0x22, 0x30, $x)

 

UARTInit( boardIndex, port, baudRate )

·         Initialize the Peripheral UART on the EZ-B v4 with the specified baud rate. The UART will stay initialized until the EZ-B v4 is power cycled, and therefore this command only needs to be called once.

·         The Board Index is the EZ-B index starting at 0.

·         The port can be 0, 1 or 2.

·         The baud rate can be between 1 and 3750000 bps. The UART receive buffers on the EZ-B v4 are 5,000 bytes.

·         Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port.

·         Example: UARTInit(0, 0, 9600 )

 

UARTAvailable( boardIndex, port )

·         Receive the count of bytes available in the Peripheral UART Receive Buffer of the EZ-B v4. The UART receive buffers on the EZ-B v4 are 5,000 bytes.

·         The Board Index is the EZ-B index starting at 0.

·         The port can be 0, 1 or 2.

·         Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port.

·         Example: UARTAvailable(0, 0)

 

UARTRead( boardIndex, port, numBytes )

·         Receive ASCII bytes from the Peripheral UART Receive Buffer of the EZ-B v4. The UART receive buffers on the EZ-B v4 are 5,000 bytes.

·         To know how many bytes are available, use the UARTAvailable() function.

·         The Board Index is the EZ-B index starting at 0.

·         The port can be 0, 1 or 2.

·         Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port.

·         Example: UARTRead(0, 0, 10)

·         Example: UARTRead(0, 0, UARTAvailable(0, 1))

 

UARTReadBinary( boardIndex, port, numBytes, variable )

·         Receive binary bytes from the Peripheral UART Receive Buffer of the EZ-B v4 into the variable as an array. The UART receive buffers on the EZ-B v4 are 5,000 bytes.

·         To know how many bytes are available, use the UARTAvailable() function.

·         The Board Index is the EZ-B index starting at 0.

·         The port can be 0, 1 or 2.

·         Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port.

·         Example: UARTReadBinary(0, 0, 10, $variable)

·         Example: UARTReadBinary(0, 0, UARTAvailable(0, 1), $variable)

 

UARTReadAvailable( boardIndex, port )

·         Receive all available ASCII bytes from the Peripheral UART Receive Buffer of the EZ-B v4. The UART receive buffers on the EZ-B v4 are 5,000 bytes.

·         The Board Index is the EZ-B index starting at 0.

·         The port can be 0, 1 or 2.

·         Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port.

·         Example: UARTReadAvailable(0, 0)

·         Example: UARTReadAvailable(0, 0)

 

UARTWrite( boardIndex, port, data )

·         Write ASCII data through the Peripheral UART.

·         The Board Index is the EZ-B index starting at 0.

·         The port can be 0, 1 or 2.

·         Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port.

·         Example: UARTWrite(0, 0, “hello world” )

·         Example: UARTWrite(0, 0, 0x30, 0x40, “hello” )

 

UARTWriteBinary( boardIndex, port, variable )

·         Write binary variable array data through the Peripheral UART.

·         The Board Index is the EZ-B index starting at 0.

·         The port can be 0, 1 or 2.

·         Look near at the UART Port section lower in this document for the EZ-B Pin’s associated with each UART Port.

·         Example: UARTWriteBinary(0, 0, $variable )

 

WaitUntilTime( hour, minute )

·         Waits until the specified time. The script will stop at this command and not continue until the specified time. The time is declared in 24 hour format.

·         Example: WaitUntilTime(17, 30)

 

MP3TriggerPlayTrack( digitalPort, baud, trackNumber, [pause time] )

·         Plays the specified MP3 track from the MP3 Trigger Sheild

·         Optionally, the Pause Time value can be used which disables the Speech Recognition control for the specified number of milliseconds.

·         Example: MP3TriggerPlayTrack( d0, 38400, 1 )

·         Example: MP3TriggerPlayTrack( d0, 38400, 1, 3000 )

 

MP3TriggerVolume( digitalPort, baud, volume )

·         Set the volume of the mp3 trigger between 0 and 255. 0 is louded, 255 is quiet.

·         Example: MP3TriggerVolume( d0, 38400, 20 )

 

MP3TriggerPlayRandomTrack( digitalPort, baud, lowestTrackNum, highestTrackNum )

·         Plays a random MP3 track from the MP3 Trigger Sheild between the supplied track numbers

·         Example: MP3TriggerPlayRandomTrack( d0, 38400, 1, 10 )

 

MP3TriggerNext( digitalPort, baud )

·         Plays the next MP3 track from the MP3 Trigger Sheild

·         Example: MP3TriggerPlayNext( d0, 38400 )

 

MP3TriggerPrev( digitalPort, baud )

·         Plays the previous MP3 track from the MP3 Trigger Sheild

·         Example: MP3TriggerPrevious( d0, 38400 )

 

MP3TriggerStop( digitalPort, baud )

·         Stops the current MP3 track from the MP3 Trigger Sheild

·         Example: MP3TriggerStop( d0, 38400 )

 

ControlCommand( windowName, ControlCommandParameter, [values] )

·         Sends a command to the window by its name. View all available ControlCommand() parameters for each control when editing a script by pressing the Cheat Sheet tab. The Cheat Sheet tab is located to the right of the script editor in ARC. Pressing Cheat Sheet tab will display a list of all available parameters for each control. Simply click on the parameter and it will insert into your code.

·         Some commands require an additional parameter. When editing EZ-Script, check the Cheat Sheet tab to view all available commands for the controls within your project.

·         This command has a shorthand alias which is “CC” (See examples below).

·         Example: ControlCommand( "ADC Graph", pauseOn )

·         Example: ControlCommand( "SoundBoard", Track_3 )

·         Example: ControlCommand( "Camera", CameraTweet, "This is an Image Description" )

·         Example: ControlCommand( "Script Manager", ScriptStart, "MyScript" )

·         Example: ControlCommand( "Speech Recognition", PauseMS, 3000)

·         Example: cc(“Auto Position”, AutoPositionAction, “Action Name”)

·         Example: cc(“Auto Position”, AutoPositionFrame, “Frame Name”)

·         Example: cc(“Auto Position”, AutoPositionFrame, “Frame Name”, 50, 3)

·         Example: cc(“Speech Recognition”, PauseMS, 2000)

 

GetControlValue( windowName, ControlCommandValues )

·         Gets a value from the window by its name. Look further down in this document for available control command parameters under the ControlCommand Values section.

·         Example: $x = GetControlValue( "ADC Graph", “pause” )

 

# Commented Text

·         Comment a line of code

·         Example: # This is a comment. This code will not run

 

:Label

·         Defines a label for a GOTO() command

·         Example:  :My_Label

 

Goto( label )

·         Goto a specific :Label location

·         Example:  Goto(My_Label)

 

Return()

·         Return from a Goto()

·         If you jump to a position of code with a Goto(), the Return statement will allow you to return back to that piece of code following the last Goto() statement.

·         If you attempt to Return() with an empty stack, nothing will happen. The script will ignore the Return() statement.

·         Example: Return()

 

If (Value Condition Value )

·         IF condition can support multiple comparisons and functions.

·         Condition tree must be closed with an ENDIF

·         See the Functions section of this document.

·         Condition can be =, <, >, <=, >=, !=, AND, OR

·         Example:

If (GetDigital(D0) = 1)

  Print(“One”)

EndIf

·         Example:

If ($Day = 2 AND $Hour = 3)

  Print(“Hello”)

EndIf

·         Example:

If (GetServo(D5) >20 OR ($x >= 3 and $y < 2))

  Print(“Yup!”)

EndIf

 

ElseIf (Value Condition Value )

·         ElseIF condition can support multiple comparisons and functions.

·         Condition tree must be closed with an ENDIF

·         See the Functions section of this document.

·         Condition can be =, <, >, <=, >=, !=, AND, OR

·         Example:

If (GetServo(D0) = 1)

  Print(“One”)

ElseIf (GetServo(D0) = 2)

  Print(“Two”)

Else

  Print(“Something Else”)

EndIf

 

Else

·         Condition tree must be closed with an ENDIF

·         Example:

If (GetDigital(D0) = 1)

  Print(“Yes”)

Else

  Print(“No”)

EndIf

 

REPEAT( variable, start, end, increment )

·         Repeats the code between REPEAT and ENDREPEAT as many times as specified. Assigns the number of times to the specified variable. This is similar to a FOR statement.

·         Example:

REPEAT($x, 0, 5, 1)

  Print(“x=” + $x)

ENDREPEAT

 

REPEATUNTIL( condition )

·         Repeats the code between REPEATUNTIL and ENDREPEATUNTIL until the specified condition is TRUE.

·         Example:

REPEATUNTIL($second = 30)

  Print(“Second=” + $second)

  Sleep(500)

ENDREPEAT

 

REPEATWHILE( condition )

·         Repeats the code between REPEATWHILE and ENDREPEATWHILE until the specified condition is FALSE.

·         Example:

REPEATUNTIL($second > 50)

  Print(“Second=” + $second)

  Sleep(500)

ENDREPEAT

 

GetServo( Port )

·         Returns the last specified Servo Position value of the servo port.

·         Servo position is between 1 and 180

·         Example: $x = GetServo(d0)

 

GetServoRealtime( Port )

·         For uart servos which accept bi-directional communication (i.e. Dynamixel, LewanSoul). This will query the servo and return the current position.

·         Example: $x = GetServoRealtime(d0)

 

GetServoSpeed( Port )

·         Returns the Servo Speed value of the specified port

·         Speed is between 0 and 10

·         Example: $x = GetServoSpeed(d0)

 

SetSpeed( speed, [speedRight] )

·         Sets the global Movement Speed value

·         If you specify only one parameter, the speed of both the left and right wheel will be modified

·         If you specify two parameters, the first parameter is the speed of the Left wheel and second parameter is the speed of the Right wheel.

·         The speed can be viewed in the Script Variable Viewer

·         Speed is between 0 (slow) and 255 (fast)

·         Example: SetSpeed(50)

·         Example: SetSpeed(50, 100)

 

SetSpeedLeft( speed )

·         Sets the global Movement Speed value of the Left wheel

·         Speed is between 0 (slow) and 255 (fast)

·         The speed can be viewed in the Script Variable Viewer

·         Example: SetSpeedLeft(50)

 

SetSpeedRight( speed )

·         Sets the global Movement Speed value of the Right wheel

·         Speed is between 0 (slow) and 255 (fast)

·         The speed can be viewed in the Script Variable Viewer

·         Example: SetSpeedRight(50)

 

GetSpeed( )

·         Returns the global Movement Speed value

·         Speed is between 0 and 255

·         The speed can be viewed in the Script Variable Viewer

·         Example: $x = GetSpeed()

 

GetSpeedLeft( )

·         Returns the global Movement Speed value of Left wheel

·         Speed is between 0 and 255

·         The speed can be viewed in the Script Variable Viewer

·         Example: $x = GetSpeedLeft()

 

GetSpeedRight( )

·         Returns the global Movement Speed value of Right wheel

·         Speed is between 0 and 255

·         The speed can be viewed in the Script Variable Viewer

·         Example: $x = GetSpeedRight()

 

GetCPUTemp( [ezb index] )

·         Returns the CPU Temperature of the EZ-B v4

·         Optionally, you can pass a parameter for the index of the ezb you wish to receive the value from, starting at index 0.

·         Example: $x = GetCPUTemp()

 

GetVoltage( [ ezb index] )

·         Returns the EZ-B v4 Battery Voltage

·         Optionally, you can pass a parameter for the index of the ezb you wish to receive the value from, starting at index 0.

·         Example: $x = GetVoltage()

 

GetADC( Port )

·         Returns the 8 Bit ADC value of the specified port

·         Example: $x = GetADC(adc0)

 

GetADC12( Port )

·         Returns the 12 Bit ADC value of the specified port on the EZ-B v4

·         Example: $x = GetADC12(adc0)

 

GetRandom( Min, Max )

·         Returns a random number between Min and Max

·         Example: $x = GetRandom(10, 50)

 

GetRandomUnique( Min, Max )

·         Returns a random number between Min and Max

·         This function attempts to make the number unique from the last time it was called

·         Example: $x = GetRandomUnique(10, 50)

 

GetDigital( Port )

·         Returns the Digital value of the specified port as a 0 or 1

·         Example: $x = GetDigital(d0)

 

ASin( value )

·         Returns the math ASin() function (also called ArcSin)

·         Example: $x = ASin(27)

 

ACos( value )

·         Returns the math ACos() function (also called ArcCos)

·         Example: $x = Acos(27)

 

Sqrt( value )

·         Returns the math Square Root function

·         Example: $x = Sqrt(9)

 

Map( input, inputMin, inputMax, containerMin, containerMax )

·         Returns a scaled value of input between containerMin and containerMax. Specify the known input’s minimum and maximum values, and the known container (output) values. For example, if you were to scale a value between -1 and 1 to 0 and 180, enter this, which returns 135.

·         Example: $x = Map(0.5, -1, 1, 0, 180)

 

Power( value, power )

·         Returns the math Power() function

·         First parameter is the input value

·         The second parameter is the power

·         Example: $x = Power(2, 4)

 

Sin( value )

·         Returns the math SIN() function

·         Example: $x = Sin(27)

 

Cos( value )

·         Returns the math COS() function

·         Example: $x = Cos(27)

 

Abs( value )

·         Returns the absolute value of a number

·         Converts a negative into a positive number

·         Example: $x = Abs(-22)

 

Round( value, decimals )

·         Returns the math Round() of a number

·         Returns the number rounded to the specified decimal places

·         Example: $x = Round($pi, 2)

·         Example: $x = Round(9.3848291, 1)

 

GetPing( trigger port, echo port )

·         Return the Ping HC-SR04 value of the specified port

·         Example: $x = GetPing(d0, d1)

 

Tweet( message )

·         Send a Twitter message using the configured Twitter account. Configure your Twitter account under File->Twitter Settings.

·         Example: Tweet("I Love EZ-Robot!")

·         You may also use the ControlCommand to Tweet images with text from a Camera Control.

·         Example: ControlCommand( "Camera", CameraTweet, "Our New Image" )

 

HTTPGet( url )

·         Send an HTTP Get command to the provided address and return the contents

·         Example: HTTPGet("http://192.168.0.10/decoder_control.cgi?command=35&onestep=5&user=admin&pwd=admin")

·         Example: $temp = HTTPGet("<http://192.168.0.15/GetTemperature.cgi >")

 

SoundNote( note, lengthMS, [signal type] )

·         Plays the specified audio note out of the EZ-B v4 speaker for the specified number of milliseconds. The sound notes are listed in this document further down.

·         Optionally, you may provide a signal type as well. The valid signal types are Sine, Square, Triangle, Pulse, Sawtooth, WhiteNoise, GaussNoise, DigitalNoise.

·         Example: SoundNote( “C2”, 1000)

·         Example: SoundNote( “C2”, 1000, “Square”)

 

Halt()

·         Exit the current running script.

·         Example: Halt()

 

Print( txt )

·         Outputs the specified text to the debug console

·         Example: Print(“This is some text”)

·         Example: Print(“Today is $Day”)

·         Example: Print(“$pi rounded is Round($pi, 2)”)

 

PrintHex( txt )

·         Outputs the hex values of the specified variable to the debug console

·         Example: PrintHex($myVariable)

 

Exec( EXE/Bat File, [parameters] )

·         Executes a windows application or batch file. The second parameter is a list of optional parameters

·         Example: Exec(“C:\Windows\Notepad.exe”)

·         Example: Exec(“C:\Windows\Notepad.exe”, “C:\MyFile.txt”)

 

Browser( url )

·         Launches the default web browser with the specified URL.

·         Example: Browser(“http://www.google.com”)

 

FileDelete( filename )

·         Deletes a file on your computer

·         Example: FileDelete(“c:\temp\mylog.txt”)

 

FileWrite( filename, contents )

·         Appends text to the specified file. This does not append a new line.

·         Example: FileWrite(“c:\temp\mylog.txt”, “My Variable: “ + $x)

·         Example: FileWrite(“c:\temp\mylog.txt”, “Servo Position: GetServo(d2)”)

 

FileWriteLine( filename, contents )

·         Appends text as a new line to the specified file.

·         Example: FileWriteLine(“c:\temp\mylog.txt”, “My Variable: “ + $x)

·         Example: FileWriteLine(“c:\temp\mylog.txt”, “Servo Position: GetServo(d2)”)

 

FileReadClose( filename )

·         Closes the file from reading.

·         This must call must be performed before writing to the file. Once you begin reading from the file, the file is OPEN. Closing the file will reset to the start once you begin reading again.

·         Example: FileReadClose(“c:\temp\mylog.txt”)

 

FileReadReset( filename )

·         Resets the file to the beginning.

·         If you read to the end of a file, this function must be called to reset reading from the beginning of the file.

·         Example: FileReadReset(“c:\temp\mylog.txt”)

 

FileExists( filename )

·         Returns a 1 or 0 if the specified file exists.

·         Example: $fileExists = FileExists(“c:\temp\mylog.txt”)

 

FileReadEnd( filename )

·         Returns a 1 or 0 if the file has reached the end.

·         Example: $fileEnd = FileReadEnd(“c:\temp\mylog.txt”)

 

FileReadChar( filename )

·         Returns the next character in the specified file

·         Example: $char = FileReadChar(“c:\temp\mylog.txt”)

 

FileReadLine( filename )

·         Returns the next line of the specified filename.

·         Example: $line = FileReadLine(“c:\temp\mylog.txt”)

 

FileReadAll( filename )

·         Returns the entire contents of the specified file.

·         Example: $contents = FileReadAll(“c:\temp\mylog.txt”)

 

FileReadLineRandom( filename )

·         Returns a random line within the specified file

·         Example: $randomLine = FileReadLineRandom(“c:\temp\mylog.txt”)

 

Split( text, splitChar, index )

·         Splits a string by the specified SplitChar into an array and returns the value at the specified index.

·         The Index is zero based, which means 0 (zero) is the first item within the array.

·         Example: $contents = Split(“One, Two, Three”, “,”, 1)

·         Example: $contents = Split(“One – Two - Three”, “-”, 2)

 

WaitForChange( value, [timeout MS] )

·         Pauses the execution of a script until the specified value has changed.

·         Optionally, the timeout parameter will stop waiting after the specified number of milliseconds.

·         Example: WaitForChange($x)

·         Example: WaitForChange(GetServo(d0))

·         Example: WaitForChange(GetDigital(d0))

·         Example: WaitForChange(GetDigital(d0), 1000)

 

WaitFor( expression, [timeout MS] )

·         Pauses the execution of a script until the specified expression is true.

·         Optionally, the timeout parameter will stop waiting after the specified number of milliseconds.

·         Example: WaitFor($AutoPositionStatus = 0)

·         Example: WaitFor($value1 = $value2)

·         Example: WaitFor($value1 = $value2, 1000)

 

Length( value )

·         Returns the length of the specified variable or string in characters/bytes.

·         Example: $len = Length(“This string is 33 characters long”)

 

GetCharAt( value, index )

·         There are two methods to obtain a character within a string. This method, which is GetCharAt(), or using the [] square brackets. See the example below.

·         Returns the character at the specified index.

·         If the character at the specified position is outside of readable ASCII, you will want to use GetByteAt() or GetByte() functions instead.

·         The Index is zero based, which means 0 (zero) is the first character.

·         Example: $char = GetCharAt(“Hello World”, 2)

·         Example: $char = GetCharAt($x, 2)

·         Example: $byte = $x[3]

·         Example: $byte = $x[$y]

 

GetByteAt( value, index )

·         Returns the ASCII Ordinal value of the byte at the specified location within the array.

·         If the byte is 0x05, this function will return an integer value of 53. Use this function to convert data read by i2c into ordinal values.

·         The Index is zero based, which means 0 (zero) is the first character.

·         Example: $value = GetByteAt(“Hello World”, 2)

·         Example: $value = GetByteAt($x, 2)

 

GetByte( value )

·         Returns the ASCII Ordinal value of a byte or byte array.

·         Technically, this function returns a number and not specifically a byte.

·         The number of bytes in the variable will determine the size of the integer returned. If one byte is passed, an 8 bit number is returned. If two bytes are passed, a 16 bit number is returned. If 4 bytes are passed, a 32 bit number is returned. If 6 bytes are passed, a 64 bit number is returned.

·         If the variable contains 0x37, this function will return an integer value of 53. Use this function to convert data read by i2c into ordinal values.

·         Example: $value = GetByte(“H”)

·         Example: $value = GetByte($x)

 

GetAsByte( value )

·         Returns the byte of the integer or first character of string.

·         If you pass 75 as the value, you will get the ASCII value of the letter K

·         Example: $value = GetAsByte(“H”)

·         Example: $value = GetAsByte($x)

 

ClearVariables( )

·         Clear all variables. Variables are not cleared between projects. You may wish to call this function in your initialization script – unless your project is using variables from another previous project.

·         Example: ClearVariables()

 

ClearVariable( variableName )

·         Clear specified variable data and removes it from memory. The variable must be within quotes.

·         Example: ClearVariable(“$MyVariable”)

 

AppendArray( variable, value )

·         Appends the value to an existing array. This grows the size/length of the array to hold the new value.

·         Example: AppendArray($myArray, 10)

·         Example: AppendArray($myArray, “banana”)

 

DefineArray( variable, size, [default value] )

·         Creates an array of the variable to the specified size.

·         Optionally, you may also pass a value that will be used for the default values.

·         Example: DefineArray($myArray, 10)

·         Example: DefineArray($myArray, 10, 2)

 

FillArray( variable, default value)

·         Fill an existing array with the default value.

·         Example: FillArray($myArray, 88)

·         Example: FillArray($myArray, “default value”)

 

GetArraySize( variable )

·         Returns the size of the specified array variable.

·         *Note: The variable passed as a parameter must be in quotations. See the example below.

·         Example: $x = GetArraySize(“$myArray”)

 

Sort( variable, [ascending | descending] )

·         Sorts the contents of the array by either Ascending or Descending direction.

·         Example: Sort( $MyArray, Ascending )

 

Count( variable, textToCount )

·         Returns the instance number of TextToCount within a variable string..

·         Example: $apples = Count(“apple apple apple apple, “apple”)

 

DumpVariables( )

·         Prints a list of all variables and their respective values separated by CRLF.

·         This is used for the TCP Server clients which require a collection of variables.

·         Example: DumpVariables()

 

IsNumeric( value )

·         Returns True or False if the specified value is numeric.

·         Example: $value = IsNumeric($x)

 

WaitForSpeech( timeOut Seconds, phrases )

·         Pauses and waits for one of the specified phrases to be spoken.

·         Returns the phrase that was spoken in lowercase.

·         Will return “timeout” if no word is detected in the specified timeout length.

·         Example: WaitForSpeech(30, “Yes”, “No”)

·         Example: $value = WaitForSpeech(30, “Yes”, “No”)

 

Contains( string1, string2 )

·         Returns TRUE or FALSE if string2 is found within string1.

·         This search is case insensitive.

·         Example: $value = Contains(“Cat In The Hat”, “Cat”)

 

IndexOf( string1, string2 )

·         Returns the first occurrence index of string2 within string1.

·         This search is case insensitive.

·         Example: $value = IndexOf(“Cat In The Hat”, “In”)

 

SubString( string1, start, length )

·         Returns the specified substring within string1.

·         Example: $value = SubString(“Cat In The Hat”, 4, 2)

 

PlayAudio( filename )

·         Plays the specified audio file to the default audio device

·         File formats can be MP3 or WAV

·         Example: PlayAudio(“c:\temp\my Audio.mp3”)

 

StopAudio()

·         Stops the current audio file that is playing through the default audio device by PlayAudio()

·         Example: StopAudio()

 

IsConnected( boardIndex )

·         Returns TRUE or FALSE if the specified EZ-B board index is connected

·         Example: $status = IsConnected(0)

 

ToString( value )

·         Converts the parameter into a string by stripping unreadable characters

·         Example: $string = ToString($hexData)

 

Min( value1, value2 )

·         Returns the lower of the two values specified.

·         Example: $lowest = Min(3, 5)

 

Max( value1, value2 )

·         Returns the higher of the two values specified.

·         Example: $highest = Min(3, 5)

 

ToHex( value )

·         Converts the integer parameter into a readable hex value string. This will convert the integer 56 into the string “0x39”. Great for debugging byte data received from i2c interface.

·         Example: $hex = ToString($hexData)

 

SetBits( bit7, bit6, bit5, bit4, bit3, bit2, bit1, bit0 )

·         Returns the value of each bit of a byte. Returns a decimal number byte of the bits. This is a useful function for i2c communication because many of the i2c devices use bits.

·         Example: $val = SetBits(1, 0, 0, 0, 0, 0, 0, 0)

·         Example: $val = SetBits(true, false, false, false, false, false, false, false)

 

ToBinaryString( value )

·         Displays the specified value in its binary representation

·         Example: $str = ToBinaryString( 254 )

 

GetBit( value, bit )

·         Returns the value of the specified bit. The LSB is bit 0, and MSB is bit 7.

·         Example: $bit = GetBit(255, 1)

 

Pause( )

·         Pauses the script at the location where it is called. To resume the script, another script must call the ControlCommand’s Resume function. Otherwise, the script can be stopped by pressing the Stop button on the control.

·         Example: Pause()

 

ComOpen( Port, Baud Rate )

·         Open the specified serial communication port on the local PC. When opened, this will also begin buffering incoming data which can be read. The input buffer is 128KB.

·         Example: ComOpen(“com1”, 9600)

 

ComClose( Port )

·         Close the specified serial communication port on the local PC.

·         Example: ComClose(“com1”)

 

ComWrite( Port, String )

·         Write the string to the specified serial communication port on the local PC. The port must be open before this command can be called.

·         Example: ComWrite(“com1”, “this is data”)

·         Example: ComWrite(“com1”, $variable)

 

ComWriteLine( Port, String )

·         Write the string as a new line to the specified serial communication port on the local PC. The port must be open before this command can be called.

·         Example: ComWriteLine(“com1”, “This is a line”)

·         Example: ComWriteLine(“com1”, $variable)

 

ComReadLine( Port )

·         Read all string data up to a newline from the input buffer of the specified serial communication port on the local PC. The port must be open before this command can be called.

·         Example: $variable = ComReadLine(“com1”)

 

ComReadAll( Port )

·         Read all available string data from the input buffer of the specified serial communication port on the local PC. The port must be open before this command can be called.

·         Example: $variable = ComReadAll(“com1”)

 

ComAvailable ( Port )

·         Returns the number of bytes/characters in the input buffer of the specified serial communication port on the local PC. The port must be open before this command can be called.

·         Example: $size = ComAvailable(“com1”)

 

ComRead( Port, Bytes to Read )

·         Read specified number of characters from the input buffer of the specified serial communication port on the local PC. The port must be open before this command can be called.

·         Example: $variable = ComRead(“com1”, 15)

 

ComClearInput( Port )

·         Clear the input buffer. The port must be open before this command can be called.

·         Example: ComClearInput(“com1”)

 

ComWriteBinary( Port, Array )

·         Write the array of data to the specified serial communication port on the local PC. The port must be open before this command can be called.

·         Example: ComWriteBinary(“com1”, $arrayVariable)

 

ComReadBinary( Port, Bytes to Read, Array )

·         Read specified number of byes from the input buffer of the specified serial communication port on the local PC. The data will be stored in the specified array. The array will be created automatically and sized to the incoming data. The port must be open before this command can be called.

·         Example: ComReadBinary(“com1”, 10, $arrayVariable)

 

PushVar( NameSpace, Cell, Value )

·         Send the value to the EZ-Cloud.

·         Example: PushVar(“DJ Sures”, “test”, “I am testing”)

 

PullVar( NameSpace, Cell )

·         Retrieve the value from the EZ-Cloud.

·         Example: $x = PullVar(“DJ Sures”, “test”)

 

ShowControl( ControlName )

·         Used for mobile devices and the Interface Builder only, this command will open the specified control into the foreground.

·         Example: ShowControl(“Wii Remote”)

 

CloseControl( )

·         Used for mobile devices and the Interface Builder only, this command will close the current control, the same as pressing the BACK button on your device.

·         Example: CloseControl()

 

ShowDesktop( desktopNumber )

·         Shows the specified virtual desktop. The desktop number is 1, 2 or 3.

·         Example: ShowDesktop(1)

 

SetVolume( volume, [ezb index] )

·         Sets the volume of the EZ-B v4 speaker

·         The volume can be a value between 0 (quite), 100 (loud), 200 (2x over drive)

·         The current volume value can be viewed in the Script Variable Monitor

·         Optionally, the index of the EZ-B may be specified

·         Example: SetVolume(50)

·         Example: SetVolume(100, 1)

 

GetVolume()

·         Gets the volume of the EZ-B v4 speaker

·         The volume will be a value between 0 (quite), 100 (loud), 200 (2x over drive)

·         The volume can be viewed in the Script Variable Viewer

·         Example: $x = GetVolume(50)

 

SleepPC( Suspend|Hibernate, force, wake )

·         Sends a command to the operating system to sleep or hibernate.

·         If Force is TRUE, the computer is forced to sleep and other applications have no say in the decision.

·         If Wake is TRUE, the computer will wake up on Wake events.

·         Example: SleepPC( Suspend, true, true )

·         Example: SleepPC( Hibernate, true, true )

 

LoadProject( filename )

·         Loads the specified project and replaces the existing project.

·         Established connections will be maintained. OnConnect scripts within the Connection Control will be executed if a connection is already established.

·         If no path is specified, this command searches for the file in the default My Documents\EZ-Builder folder.

·         If no extension is provided, the .ezb default extension is assumed.

·         For obvious reasons, no further commands following LoadProject() are executed.

·         Example: LoadProject(“MyTest”)

·         Example: LoadProject(“MyTest.ezb”)

·         Example: LoadProject(“C:\Temp\MyTest.ezb”)

 

CheckForUpdate()

·         Checks the EZ-Robot server if there is a newer version of ARC available.

·         This requires an internet connection.

·         Example: $x = CheckForUpdate()

 

 

References

 

Multiple EZ-B Boards

 

ARC supports multiple physical EZ-B Boards connected to your computer. You can specify the board by putting the board number in front of the port. For example: Servo(2.d0, 8) will move the D0 servo on EZ-B board #2 to position 8. If no board index is specified, the first board (zero) is assumed. If using more than one board, the first board is always responsible for movement panels.

 

ADC Ports

The ADC Ports are labeled on the EZ-B as A0 to A7. They are Analog Input ports, which read the voltage of the incoming data between 0 and 5 volts. Consult the Learn Section of our website for more information on Port Types.

·         ADC0

·         ADC1

·         ADC2

·         ADC3

·         ADC4

·         ADC5

·         ADC6

·         ADC7

 

Virtual Servo Ports

The Virtual Servo Ports do not actually control any physical hardware. You will find the Virtual Servo Ports in any control that uses a servo. These can be used in exchange of using variables for storing servo positions, or using servo controls.

·         V0

·         V1

·         V2

·         V3

·         V4

·         V5

·         V6

·         V7

·         V8

·         V9

·         V10

·         V11

·         V12

·         V13

·         V14

·         V15

·         V16

·         V17

·         V18

·         V19

 

 

Servo/Digital Ports

These ports are used to turn on and off devices with voltage. The digital ports can also be used for detecting if the input voltage is in an On or Off state. For output, the digital ports may control servos, transmit PWM (Pulse Width Modulation) and send serial data. Consult the Learn Section of our website for more information on the different modes of Digital Port Types.

·         D0

·         D1

·         D2

·         D3

·         D4

·         D5

·         D6

·         D7

·         D8

·         D9

·         D10

·         D11

·         D12

·         D13

·         D14

·         D15

·         D16

·         D17

·         D18

·         D19

·         D20

·         D21

·         D22

·         D23

 

UART Ports

The UARTx ports are used connect to Serial TTL devices for both input and output. Contrary to the digital port Serial Output, these peripherals will also receive data into an input buffer as well. The input buffer of each UART is 5,000 Bytes. There are 3 UARTs, the first is the hardware labelled port, second and third are digital pins. These UARTs are controlled using the UARTInit(), UARTWrite(), UARTRead() and UARTAvailable() commands. The speed of these UARTs can be any integer between 1 and 3750000 bps.

·         UART0 TX: Expansion Connector

·         UART0 RX: Expansion Connector

·         UART1 TX: D5

·         UART1 RX: D6

·         UART2 TX: D18

·         UART2 RX: D19

 

Digital Port Outout Baud Rates

The digital ports can output Serial, which differs from the UART. Using any digital port as a Serial Output command can be done by using the SendSerial() command. Using a digital port this way does not include an input buffer. For input buffers, use the UARTx functions.

·         300

·         1200

·         2400

·         4800

·         9600

·         19200

·         38400

·         57600

·         115200

 

ControlCommand Values

You can receive values for controls using using the GetControlValue() command. The syntax for this command can be found above in this document. Each control will accept a different collection of commands, which are listed here.

 

            All Controls

·         Pause

 

Variable Types

Variables are global throughout the entire ARC environment. The Variable Watcher Control allows you to watch variable values in real-time. Variable types are dynamic by assignment, meaning there is no specific type definition between String, Integer and Floating point.

 

Examples:

·         String: $str = “This is a string”

·         String Concat: $str = “fu” + $bar

·         Integer: $number = 6

·         Floating Point: $dec = 3.14

·         Byte: $byte = 0x52

·         Boolan: $bool = true

·         Result Condition: $result = ($x > $y)

·         Increment numeric: $number++

·         Decrement numeric: $number—

·         Binary Shift Left: $x = 123 << 1

·         Binary Shift Right: $x = 123 >> 1

 

Scientific Math Functions

· Sin()

· Cos()

· Tan()

· Sec()

· Csc()

· Cot()

· ASin()

· ACos()

· ATan()

· SinH()

· CosH()

· TanH()

· Abs()

· Sqrt()

· Ciel()

· Floor()

· Exp()

· Log10()

· Log()

· Max()

· Min()

· Round()

· E()

· Pi()

· Now()

· Today()

 

DateTime Functions

· MinDate( date1, date2 )

· MaxDate( date1, date2 )

· MonthName( monthNumber )

· AddDays( date, days )

· AddMonths( date, days)

· AddYears( date, years )

· AddHours( date, hours )

· AddMinutes( date, minutes )

· AddSeconds( date, seconds )

· TotalHours( date )

· TotalMinutes (date )

· TotalSeconds (date )

· FmtTimeSpan( value, format)

·         Get number format from https://msdn.microsoft.com/en-us/library/ee372287.aspx

·         Example:

·         $hours = FmtTimeSpan(CDateTime("10/29/2016 1:00:00 PM") - CDateTime("10/28/2016 2:02:02 PM"), "hh")

· FmtNum( value, format)

·         Get number format from https://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx

· FmtDate( value, format)

·         Get date format from https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx

 

Casting Functions

These functions are to cast objects from one datatype to another

· To Double: CDBL()

· To Integer: CInt()

· To Long: CLong()

· To Unsigned Integer: CUint()

· To Unsigned Long: CULong()

· To DateTime: CDateTime()

 

Variable Constants/Reserved Words

These variables are read-only reserved words and cannot be assigned.

· $direction

· $date

· $month

· $year

· $day

· $dayName

· $hour

· $minute

· $second

· $monthName

· $time

· $pi

 

Sound Music Notes

The EZ-B v4 can be told to play audio tones. They may be simple, but it is fun – here is a list of parameters for the SoundNote() functions. The syntax for the function can be found above in this document. Here are the acceptable notes…

·         C1

·         Db1

·         D1

·         Eb1

·         E1

·         F1

·         Gb1

·         G1

·         Ab1

·         A1

·         Bb1

·         B1

·         C2

·         Db2

·         D2

·         Eb2

·         E2

·         F2

·         Gb2

·         G2

·         Ab2

·         A2

·         Bb2

·         C3

·         Db3

·         D3

·         Eb3

·         E3

·         F3

·         Gb3

·         G3

·         Ab3

·         A3

·         Bb3

 

Auto Start Command Line Options

 

ARC supports two command line options for loading a project, and/or executing a script. If you wish to have ARC auto-load from a shortcut, the command line parameters allow you to specify an auto connect also. You may use the Shortcut Creator, located under the File Menu.

 

Parameter 1: The path and filename of the project file you wish to load apon startup.

Parameter 2: The name of the script control you wish to execute apon startup.

 

·         "c:\Program Files\EZ-Builder\EZ-Builder.exe "C:\files\My File.ezb"

·         "c:\Program Files\EZ-Builder\EZ-Builder.exe "C:\files\My File.ezb" "InitScript"