Writing to Relay Control | To set one or more relays write a “1” to the bit controlling that relay: | |||
Registers | 1. Determine the register and bit locations for the relays you want to set. | |||
| ||||
| 2. Add the decimal values for each bit you want to set in a register. | |||
| 3. Use the VXI:REG:WRITe command to write that decimal value to that | |||
| register. |
|
|
|
| Examples: Writing to Relay Control Registers | |||
| In these examples, since you are writing 1s to specific bits, the process | |||
| actually writes 0s to all other bits in that register thus resetting those relays. | |||
| To maintain previously established signal paths, you should read the | |||
| register state and “mask” those bits when writing to the register. | |||
NOTE |
| |||
If Bit 15 is a “1”, BASIC language programming uses a 2s compliment | ||||
| number so the decimal value is negative. For example, FFFFh = | |||
| 8000h = |
|
| |
| If all relays are in their | |||
| channel CH002 to COM 00), set bit 1 (decimal value 2) in register (base + | |||
| 20h). Use the commands: | |||
|
|
|
| !Selects logical address |
| VXI:E |
|
| !Writes value 2 to register 20h |
| To set relays K001, K003, K014, K013, and K024 (connect CH 001 to | |||
| COM 02) set bits | 2, 7, 6, and 11 (decimal values 1, 4, 128, 64, 2048 | ||
| respectively), send the decimal value 2245 (1 + 4 + 128 + 64 + 2048 = 2245) | |||
| to register 20h. Use the commands: | |||
|
|
|
| !Selects logical address |
| Similarly,VXI:REG:WRITto reset20,2245a relay to its | |||
| respective bit. |
|
|
|
Reading from Relay | Use the VXI:REG:READ? command to read the value of a register. The | |||
Control Registers | value returned is the | |||
| are set to “” (relays in the “set” state). At | |||
| should be . Use the command: | |||
| SL120 |
|
| !Selects logical address |
|
|
| !Reads from register base + 20h | |
| RG:WRIT20,2 |
| ||
| Examples: Writing to Relay Control Registers | |||
| VXI:The followingE | table shows examples of the decimal values needed to write | ||
| to a register(s) to connect signal paths. Hundreds more combinations are | |||
| possible. These tables only show representative samples. Negative values | |||
| are 2s compliment. |
| ||
| SL120 |
|
|
|
Appendix B | SLRG:READ?120 | 20 |