View Single Post
Old November 30th, 2017, 06:45 PM   #2
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,858
I have not used the raw serial port myself but some ideas:
1) Timing. All together, it happens too fast for the slaves to handle. It might be that after the first PortPrint instruction, the slave responds, but if you run another instruction too quickly, the response gets mishandled or the slave isn't ready to receive again.

2) Invisible character. When you combine the logic into one program, are you using two PortPrint instructions? There may be a termination character that gets sent at the end of the instruction that is missing in between the instructions...

I am not sure if there is an easy way to add a delay inside a program, but you might be able to use a PortRead instruction with a short delay period to provide some time between the two PortPrint()s.
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants.
  Reply With Quote