View Full Version : "simulate" multi-thread on the BS2E

Jack Jordan
09-09-2008, 08:34 AM
Is it possibly to "simulate" a multithread output on the BS2e with the OUTL, OUTH command ?

variable_1ˇˇ VARˇˇˇ OUTLˇˇˇˇ:DIRL %11111111
variable_2ˇˇ VARˇˇ ˇOUTHˇˇˇ :DIRH %11111111

outData_1ˇˇ DATAˇˇˇˇˇˇˇˇˇˇˇ %10000001
outData_2ˇˇ DATAˇˇˇˇˇˇˇˇˇˇˇ %01000010
.... etc.

ˇˇˇ READ Location, {Word} Variable {, {Word} Variable, ...}ˇˇˇˇˇˇˇˇˇˇˇˇˇ ' outData_1
ˇˇ READ Location, {Word} Variable {, {Word} Variable, ...}ˇˇˇˇˇˇˇˇˇˇˇˇˇ ' outData_2


Mike Green
09-09-2008, 08:47 AM
It's certainly possible to input or output several bits at the same time. You can use the READ statement to read a word at a time into a word variable which can be OUTS. I'm not sure whether the word READ works on a BS2e or you need a BS2p/pe/px for that. In any event, you can do two byte READs to OUTL then OUTH to do the same thing a little bit slower.

What are you trying to do?

Jack Jordan
09-09-2008, 08:50 AM
Let me check my code. Be right back

Jack Jordan
09-09-2008, 09:05 AM
What I can share at this time - careful who you ask for what.

One 8 bit port can run two sepper motors in the same direction or +/- fortyfive, ninty degrees from the same data set, nest FOR...NEXT_Forward, FOR...NEXT_Reverse. It can also hold one motor and step the other.

The code at this time is cumbersum at best.