Scale Basic Reference and Tutorial Version 4.2E Date 9/6/2001
Scale Basic 4.2E Tutorial Event Driven Programming Event Driven programming is useful for ‘real time’ applications. Real time applications are thos
Scale Basic 4.2E Tutorial Design Template To help in the design process, we will use the following design template. The first 4 sections (Applicatio
Scale Basic 4.2E Tutorial Scale Basic Tutorial The following section assumes that the indicator is connected to a PC computer using EZ Link. If you
Scale Basic 4.2E Tutorial Use the template above to enter and test the program. The program can be extracted from the Event and Function sections of
Scale Basic 4.2E Tutorial The permanent storage registers (Fixed43…50) are used for permanent storage of numbers. These registers are stored in EA-R
Scale Basic 4.2E Tutorial The above function uses Memory1, 2, and 3. The memory registers used are listed in the Parameters section of the design tem
Scale Basic 4.2E Tutorial Setpoint Monitors Purpose1: to monitor 2 registers and activate a scale basic function when the lower register is greater
Scale Basic 4.2E Tutorial The Setpoint Monitor is used to generate the next event. When the setpoint event occurs, it activates user function 2 whic
Scale Basic 4.2E Tutorial 6. In EZ Link select File, Save As, then type in “test3” then click OK. This saves the program onto disk. 7. In EZ Lin
Scale Basic 4.2E Tutorial Scale Basic function is executed. There are 5 timer records that contain the following data: Time interval time interval
Scale Basic 4.2E Table of Contents Table of Contents Introduction ...
Scale Basic 4.2E Tutorial 3. Scale Basic enter the following program: Function Instructions Comments User 1 Timer on, 5 turn on timer
Scale Basic 4.2E Reference Reference The reference is divided into 3 sections: 1. Instruction Reference: details each Scale Basic instruction and p
Scale Basic 4.2E Reference Test for Net >= Fixed43 Compare, Net, Fixed43 If not, Negative If Net >= Setpoint Fixed43 Relay
Scale Basic 4.2E Reference Remarks: sets condition codes Positive, Negative, and Zero to reflect results. The decimal position of the result before
Scale Basic 4.2E Reference Remarks: Use this instruction to alert the operator that an error condition has occurred. The message is displayed until
Scale Basic 4.2E Reference The prompt is displayed for 0.7 seconds, then if the register is non-zero, the register data is displayed. If the registe
Scale Basic 4.2E Reference Get id, Memory1 Open Id 25 If, Zero If the Id was not found Error msg, 8 display error me
Scale Basic 4.2E Reference Flag on, 1 turn on flag 1 Display Memory1 set to display Memory1 (total) End if End if End
Scale Basic 4.2E Reference Set Memory1, 3 Memory1 = 3 Index id, Memory1 Open ID record 3 (the 3d record in memory) Set Id1, 0
Scale Basic 4.2E Reference Set Memory1, 20 Loop1 For Memory1 = 20 down-to 0 Index id, Memory1 Set Id1, 0 ID[Memroy1
Scale Basic 4.2E Introduction Introduction Scale Basic in a programming language that is used to modify the functions of a weight indicator. This
Scale Basic 4.2E Reference Next1 (see Loop1 / Loop2 instruction) 246 Next2 (see Loop1 / Loop2 instruction) 248 Nop 254 Purpose: no-
Scale Basic 4.2E Reference Relay on, 10 turn relay number contained in Memory10 on Example: turn off all relays. If scale is at center
Scale Basic 4.2E Reference Sign [r] 207 [r] Purpose: to set condition codes based on the value in register [r]. Positive is set if the regi
Scale Basic 4.2E Reference Timer off / Timer on (n) 225 [n] / 224 [n] Purpose: to activate / de-activate a timer. Remarks: the acti
Scale Basic 4.2E Reference Fn. 4: All off turn off all timers, relays, etc. End End of function. Txcom1 / Txcom2 (n)
Scale Basic 4.2E Reference Remarks: this instruction takes a minimum of 3 A/D conversion cycles. Press the Clear key to abort Valid wt command; also
Scale Basic 4.2E Reference Condition Codes The condition codes are used in the IF instruction to determine if the instructions following the IF are t
Scale Basic 4.2E Reference Flags 10 -16 Purpose: Enables control of status LEDs on display panel (Gross, Net, Motion. Zero, Lb, Kg) Remarks: Fl
Scale Basic 4.2E Reference Netmode 103 Purpose: true if display is in Net mode. Overload 115 Purpose: true if scale status = Overload Pos
Scale Basic 4.2E Reference Built in Functions Close id 142 Purpose: use after Open id or Open new to save ID data to memory. Remarks: the Clos
Scale Basic 4.2E Tutorial EZ Link EZ Link is a Microsoft Windows compatible program that you can use to configure, program, and test the indicator. T
Scale Basic 4.2E Reference Print1, Print2, Print3, Print4 133, 134, 135, 146 Purpose: to send formatted data to the printer. Remarks: there are
Scale Basic 4.2E Reference Remarks: the Suspend instruction stops a Scale Basic function from executing, thus allowing the Event Monitor to scan for
Scale Basic 4.2E Reference Loop1 While - If Motion Motion on scale Update Update scale readings Next1 End - End if
Scale Basic 4.2E Reference Example Purpose1: trigger user function 1 when gross weight is greater than Memory register 12 (weight above setpoint).
Scale Basic 4.2E Reference Timer Events Purpose 1: to trigger a scale basic function after a set time interval. Purpose 2: to wait an interval of t
Scale Basic 4.2E Reference Flag on, 1 turn on flag 1 Relay on, 1 turn on relay 1 End if End if This example will caus
Scale Basic 4.2E Reference Example2: a bar code reader is used to read the tare weight for the scale. Setpoint 1 is configured to trigger when a ba
Scale Basic 4.2E Reference Remarks: xxx can be any valid register number. The data is transmitted in the form: nnnnnnnnn<cr> where nnnnnnnnn i
Scale Basic 4.2E Reference S / I Purpose: Status / Idle pairs are used to verify that a remote station is available to accept commands. Remarks: net
Scale Basic 4.2E Reference Registers There are 5 types of registers: memory registers, fixed registers, scale registers, Id registers and special pur
Scale Basic 4.2E Tutorial EZ Link Configuration The indicator’s communications port 2 [Com Port 2] defaults to 9600 baud, 8 bits, no parity. The EZ
Scale Basic 4.2E Reference 61 Alt units - Gross weight 62 Alt units - Tare weight 63 Alt units - Net weight 64 Gross Weight 65 Tare Weight 66 Net
Scale Basic 4.2E Reference Time / Date Logging Modification 118 Time Time Register The Time register has the following uses: Copy, <register&
Scale Basic 4.2E Reference Error Codes Err 0 Power on acquire zero error. Occurs when parameter 20 is set to acquire zero on power-up. If the scal
Scale Basic 4.2E Appendix A: Design Template Appendix A: Design Template Application Description. This is a general description as given by the cu
Scale Basic 4.2E Tutorial EZ Link Test Use this procedure to test the connection between the indicator and the PC. On the PC: If you are using Window
Scale Basic 4.2E Tutorial Test 5 Press the indicator’s CLEAR key to exit diagnostic test 4. Enter test number 6 and then press the ENTER key. This t
Scale Basic 4.2E Tutorial Event Driven Programming This section provides an introduction to event driven, computer program design. Program Design T
Scale Basic 4.2E Tutorial Sequence of operation Enter target weight data: Use the indicator’s built in memory register input function. Th
Comments to this Manuals