hello Jeremy

am back as i said I would. I need some help because I got confused on
how I should implement this section of the code in labVIEW...

for count:=0 to 7 Do Begin        { do the bit value eading 7 times }
      **value:=value SHL 1;            { value=2*value }
      Port[LCR]:=64;                 { clock line up }
     ** If (port[MSR] and $10)=$10 Then Inc(value);   { read the input
     data and update value }
      Port[LCR]:=0;                  { clock line down }

**am not really sure what this line is supposed to be doing and am not
sure how to implement it in labVIEW?? can you help please?

Bupe

p.s. thought i may as well add the whole code...

Procedure Initialize_converter;
Begin
   Port[MCR]:=3;    { make DTR line to supply power and set CS input
   of chip to 1 }
   Port[LCR]:=0;    { set clock line of the chip to 0 }
End;

Function Read_value:byte;
Var
   value:byte;
   count:byte;
Begin
   value:=0;
   Port[MCR]:=1;                     { set CS down }
   For count:=0 to 7 Do Begin        { do the bit value eading 7 times
   }
      value:=value SHL 1;            { value=2*value }
      Port[LCR]:=64;                 { clock line up }
      If (port[MSR] and $10)=$10 Then Inc(value);   { read the input
      data and update value }
      Port[LCR]:=0;                  { clock line down }
   End;
   Port[MCR]:=3;                     { set CS up again }
   Read_value:=value;                { return the value }
End;

Begin
   Initialize_converter;            { call initialization routine }
   Repeat
      Writeln(Read_value);          { call reading routine and print
      the value }
   Until KeyPressed;                { repeat until any key is pressed
   }
End.

Reply via email to