Steve Roks
09-30-05, 12:59 AM
Hi Max Forth is the first computer language I have ever tried to learn so please be patient if my problems seem simple. I have read through the manuals and looked through the examples but am having a problem sending the system variable I have created to a second iso pod ( both v2 / .82 ) over the SCI1 PORT. I can test the ports and wiring by sending a single character with " 12 SCI1 TX" and checking the second pod with " SCI1 RX . " "12" is returned.
this is the program I am working on for the first pod which reads 2 analog inputs ( 1 for position and 1 for trim ) and calculates a corrected position using floating point # between 1 - 32,000. I store this position as a fvariable and want to transmit it to the second pod on/over SCI1 where I will compare and control motors. This is where I have run into a problem. The website is full of info but a little slim on the SCI examples.
A few hints at this point would be greatly appreciated. I have pasted my first program ever :) please feel free to edit, add, suggest as I truly have no idea what I'm doing....lol
COLD
SCRUB
DECIMAL
0.25E0 FCONSTANT POFF ( PAN OFF SET 1:4 )
4000E0 FCONSTANT PTRM ( PAN TRIM VALUE )
118.5E FCONSTANT PDGR ( PAN DEGREE CALCULATION FACTOR 270 DEGREE / 32000 )
32000E FCONSTANT PLMT ( PAN HIGH LIMIT )
1.0E FCONSTANT PLOW ( PAN LOW LIMIT )
38400 SCI1 BAUD
FVARIABLE PAN
DECIMAL HERE 12 ALLOT CONSTANT BUFFER1
DECIMAL HERE 12 ALLOT CONSTANT BUFFER2
: STARTUP 38400 SCI1 BAUD
BUFFER1 12 SCI1 RXBUFFER
BUFFER2 12 SCI1 TXBUFFER ;
: PANPOSITION BEGIN
ADC0 ANALOGIN S>F PTRM F+
ADC2 ANALOGIN S>F POFF F*
F-
PLMT FMIN PLOW FMAX
PAN F!
UNTIL ;
: PANTRANSMIT SCIS PAN F@
SCI1 TX ;
: PANLOOP BEGIN
STARTUP
PANPOSITION
PANTRANSMIT
13 EMIT PAN F@ F.
UNTIL ;
thanks in advance,
Steve
this is the program I am working on for the first pod which reads 2 analog inputs ( 1 for position and 1 for trim ) and calculates a corrected position using floating point # between 1 - 32,000. I store this position as a fvariable and want to transmit it to the second pod on/over SCI1 where I will compare and control motors. This is where I have run into a problem. The website is full of info but a little slim on the SCI examples.
A few hints at this point would be greatly appreciated. I have pasted my first program ever :) please feel free to edit, add, suggest as I truly have no idea what I'm doing....lol
COLD
SCRUB
DECIMAL
0.25E0 FCONSTANT POFF ( PAN OFF SET 1:4 )
4000E0 FCONSTANT PTRM ( PAN TRIM VALUE )
118.5E FCONSTANT PDGR ( PAN DEGREE CALCULATION FACTOR 270 DEGREE / 32000 )
32000E FCONSTANT PLMT ( PAN HIGH LIMIT )
1.0E FCONSTANT PLOW ( PAN LOW LIMIT )
38400 SCI1 BAUD
FVARIABLE PAN
DECIMAL HERE 12 ALLOT CONSTANT BUFFER1
DECIMAL HERE 12 ALLOT CONSTANT BUFFER2
: STARTUP 38400 SCI1 BAUD
BUFFER1 12 SCI1 RXBUFFER
BUFFER2 12 SCI1 TXBUFFER ;
: PANPOSITION BEGIN
ADC0 ANALOGIN S>F PTRM F+
ADC2 ANALOGIN S>F POFF F*
F-
PLMT FMIN PLOW FMAX
PAN F!
UNTIL ;
: PANTRANSMIT SCIS PAN F@
SCI1 TX ;
: PANLOOP BEGIN
STARTUP
PANPOSITION
PANTRANSMIT
13 EMIT PAN F@ F.
UNTIL ;
thanks in advance,
Steve