Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Communication with Ser.Putlong Question — Parallax Forums

Propeller Communication with Ser.Putlong Question

Andy_ouhscAndy_ouhsc Posts: 17
edited 2011-07-06 09:21 in Propeller 1
Hello,
I am working on a project which requires the communication between the program Labview and Propeller.
So far I have it working, partially working, there exists a problem/ a question I have...
Object:
ser: "Fulldeplexserialplus"

I know ser.putlong(somerandomvariable) can transmit my number to my other program of Labview, I can then display the value on some sort of graph.

My main question/concern is that I am gathering two different values to transmit it through Labview.

Example: My propeller is measuring the 8 total values of a and b at the same time. (4 a+ 4b through repeating loops)
Let's say it would be like.... a=1, b=2 ......a=3, b=4.....a=5,b=6.....a=7, b=888
I know that ser.putlong(a) and ser.putlong(b) are both required.
I want in Labview, a display of "a": 1,3,5,7 and a display of "b": 2,4,6,8

I DO NOT want : 1,2,3,4,5,6,7,8


How would I distinguish a and b when it goes into Labview? Can this be fixed through propeller?


Thanks,
Andy

Comments

  • doftdoft Posts: 4
    edited 2011-07-05 15:31
    Hello,

    You could try sending values a as signed positive and b as signed negatives. That would make it easy to differentiate between the two. All a values greater than 0, all b values less than 0. You can fix b values by multiplying them by -1 in labview.
  • Andy_ouhscAndy_ouhsc Posts: 17
    edited 2011-07-06 07:56
    Thank you, but sorry that does not answer my question.
    My values contain both positive and negative numbers in the project for both sets of data.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2011-07-06 09:21
    Why not read the 8 values into 2 arrays (a[0] to a[3] and b[0] to b[3]). Then send the 4 a values to Labview followed by the 4 b values.

    John Abshier
Sign In or Register to comment.