11-09-2007 01:28 PM
Hello,
I have been having the same issues for some time now. What appears to be happening is I get the number out of sequence. In other words when I expect a result of 138 counts I get something like 2560. Looking at it in hex it should be 00 8A, where I am getting 0A 00. After talking to the manufacture, I was told the first byte is the least significant and the second is the most significant byte. See below the PIC programming from the manufacture on how the data is sent. I have attached my block diagram of my vi program which read the data and moves it on to my main vi (not shown).
‘REM John Iovine 11/04
'Read Digital Output & send RS-232 info to PC
'Use 16F84-20MHZ microcontroller & 16 MHz Xtal
DEFINE OSC 16 'Use 16 MHZ Xtal
'Declare word variables
w1 VAR WORD
Start: ‘Main Program
Count PORTB.0, 1000, w1 'Count pulses every second
SerOut 1,6, [w1.byte0, w1.byte1] 'Send Information to PC
GoTo Start 'Do it again & again & again & ....
End
I think my issue is a timing thing. Should I use a timed while loop, or use a wait command?
11-09-2007 01:42 PM
11-09-2007 02:30 PM - edited 11-09-2007 02:30 PM
11-09-2007 03:03 PM
11-09-2007 03:06 PM
OK, thanks. I will give that a shot! Have a good weekend.