Reading Inputs of a Stamp PLC
Mccoy
Posts: 2
Hi I've just started working with the Stamp PLC (Stamp BS2 installed).
Everthing is very easy, except reading the first digital 8 Input lines.
I got the example to work. But I need to read each point and check to see if it is·on/off.
I tried to use VAR.BIT1 thinking I could read each bit of the word gotten via the SHIFTIN command. But that·does not work.
Any thoughts would be welcomed
Thanks. Blaine
Everthing is very easy, except reading the first digital 8 Input lines.
I got the example to work. But I need to read each point and check to see if it is·on/off.
I tried to use VAR.BIT1 thinking I could read each bit of the word gotten via the SHIFTIN command. But that·does not work.
Any thoughts would be welcomed
Thanks. Blaine
Comments
· GOSUB Read_DigIns
... all of the inputs are available as aliased bits (i.e., dIn1, dIn2, ... dIn10).· Make sure you call the Read_DigIns before you access one of those variables so that you have the current state of the inputs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA