A few SX questions
HenkieD
Posts: 8
Hi everybody,
I'm setting my first steps to the SX. In the past few moths I have been quiet busy with the Stamp, and am very pleased to see now that the SX is also programmable in a higher language like basic...
This makes my life as PLC, VB programmer a lot easier...
To get get to the point...
On my SX I need to "count" a pin state change in a certain time frame.
For the Stamp it's easy
Count pin, time, result
But how or what is the easiest way in SX Key
Second question :
The SX must 'talk' to a stamp, I would like to use flowcontrol to have a proper and reliable communication.
Must I create something like this or is their some assembler that I can add in my
SX/B program?
For receiving :
Main:
· ...do other tasks
Recieve:
·Low CTS
·Serin RX, Baud, dByte, 500, No_Data
·High CTS
·Put idx, dByte
·idx = idx + 1
·Goto Receive
No_Data:
· High CTS
··Goto Main
For sending :
Main:
· ...do other taks
Check_RTS:
· If RTS = OFF then·Send
· Goto Main
Send:
· Get idx, dByte
· Serout TX, Baud, dByte
· idx = idx + 1
· Goto Main
Many thanks in advance...
Henk
·
I'm setting my first steps to the SX. In the past few moths I have been quiet busy with the Stamp, and am very pleased to see now that the SX is also programmable in a higher language like basic...
This makes my life as PLC, VB programmer a lot easier...
To get get to the point...
On my SX I need to "count" a pin state change in a certain time frame.
For the Stamp it's easy
Count pin, time, result
But how or what is the easiest way in SX Key
Second question :
The SX must 'talk' to a stamp, I would like to use flowcontrol to have a proper and reliable communication.
Must I create something like this or is their some assembler that I can add in my
SX/B program?
For receiving :
Main:
· ...do other tasks
Recieve:
·Low CTS
·Serin RX, Baud, dByte, 500, No_Data
·High CTS
·Put idx, dByte
·idx = idx + 1
·Goto Receive
No_Data:
· High CTS
··Goto Main
For sending :
Main:
· ...do other taks
Check_RTS:
· If RTS = OFF then·Send
· Goto Main
Send:
· Get idx, dByte
· Serout TX, Baud, dByte
· idx = idx + 1
· Goto Main
Many thanks in advance...
Henk
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
It is still not clear for me how I can 'monitor'·a specific pin on time base.
As far as I understand the Count command, it looks like a sort of time interrupted fuction (or am I wrong).
Must I use the 'Interrupt...Returnint', and set my timeframe depending on the frequence that the SX is running, or is their another way.
The project I'm working on is a·color reading device with approx 8 TCS230 sensors, maybe that can help to get an idea of where I'm going to.
Greetings from eThekwini
Henk
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I got hooked up by the time interrupt thing, I'm more used to think cyclically because of my plc programming backgrounds.
Greetings from eThekwini
Henk
(PS : Do you guys ever sleep?)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax