LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cont: Serial port 8bit ADC circuit

Guys, am back again but this time with a different ADc ciruit. Before I asked about reading from an 18bit ADC circuit using labVIEW but this time I want to know if its possible to read an 8bit ADc ciruit instead. The only this about this circuit is that it does not use standard RS232 so I am wondering whether that would cause a problem or not. I just want to know if I can be able to write code to read from this ciruit or not and what factors I need to consider.

The circuit can be found here: http://www.epanorama.net/circuits/ad_serial.html

The source code provided was written in Pascal, can it be rewritten in LabVIEW? Will the Serial Port VI's be able to read from this circuit? Please please help.

Bupe
0 Kudos
Message 1 of 6
(2,921 Views)
Hurray for epanorama!!

I think you will be able to do this. What concerned me was controlling the exact lines of the serial port. I searched NI's site and found How Can I Control the DTR and RTS Serial Lines in LabVIEW?. I think this is the info needed to complete the serial concerns. You can search NIs site at the advanced search page. It is very useful.
0 Kudos
Message 2 of 6
(2,921 Views)
Thanks alot for the tip Jeremy, that helped alot. I have actually managed to get a reading using the Pascal code the circuit came with and now my next step is to implement the same code but this time using LabVIEW and from what you pointed out I should be able to do this hoplefully. Thanks again.

I'll probably be back again with another question...
🙂
0 Kudos
Message 3 of 6
(2,921 Views)
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.
0 Kudos
Message 4 of 6
(2,921 Views)

Hello Kudos,

 

Were you able to solve your problem? I am kinda working on a similar circuit. Is it possible for yoy to share your vi.

 

Thank in advance

0 Kudos
Message 5 of 6
(2,328 Views)

Did you look at the dates? This thread is >8 years old. None of the participants has logged in since 2006.

 

Please start a new thread. Give details of what you are trying to do, what you have tried, and what help you need. The more specific your question, the more likely that you will get a helpful answer.

 

Lynn

0 Kudos
Message 6 of 6
(2,312 Views)