Step 1b - Set appropriate outputs
MSpups = MSpups AND (NOT(mask))
LSpups = LSpups AND (NOT(mask))
By "ANDing" the current
Step 1c - Completing the command string:
Cmnd$ = "!" + CHR$(Maddr) + "SS" + CHR$(MSpups) + CHR$(LSpups)
Step 2 - Transmitting the command string:
Print #1, Cmnd$;
Example 5.5 - Set Output #5's
'Set module address to 4.
Maddr = 4
'Set bit 0 of LSpups to make Output #5's
LSpups = LSpups OR &H20
'Clear bit 4 of MSpups to make Output #13's
MSpups = MSpups AND (NOT(&H20))
Cmnd$ = "!" + CHR$(Maddr) + "SS" + CHR$(MSpups) +
CHR$(LSpups)
PRINT #1, Cmnd$;
MSIO$ = INPUT$(1,#1)
Module's #4 output line #5's
Set Module Address Command
The Set Module Address command is used to change the
address of the 485SDD16. This command requires a data byte.
The data byte is used to specify the new address of the module. Step 1 - Construct the command string:
Cmnd$ = "!" + CHR$(Maddr) + "SA" + CHR$(Naddr)
Where Maddr if the module's current address and Naddr is the module's new address.
Step 2 - Transmitting the command string:
Print #1, Cmnd$;
27 |
Example 5.6 - Change the address of module with a current address of 4 decimal to the new address of 5 decimal.
Maddr = 4
Naddr = 5
Cmnd$ = "!" + CHR$(Maddr) + "SA" + CHR$(Naddr)
Print #1, Cmnd$;
Set
The Set
Step 1 - Construct the command string:
Cmnd$ = "!" + CHR$(Maddr) + "SC" + CHR$(Ntdly)
Where Maddr if the module's address and Ntdly is the module's new
Step 2 - Transmitting the command string:
Print #1, Cmnd$;
Example 5.7 - Set the
Maddr = 5
Ntdly = 10
Cmnd$ = "!" + CHR$(Maddr) + "SC" + CHR$(Naddr)
Print #1, Cmnd$;
28 |
B&B Electronics | B&B Electronics |
PH (815) | PH (815) |