04-18-2012 10:32 AM
OK, I have a program that I think is working so far. I'm sending instructions to polhemus, then getting a string of 1s and 0s back.
Now in that string, there are 4 16 bit segments that I need with every itteration. These are my 4 data points in quarternians. Does that make sense?
So say I'm getting
0101000101010101010100101101010101010101101010011010101010110100
I need these 4 pieces:
0101000101010101
0101001011010101
0101010110101001
1010101010110100
And that will make up 1 measurement.
So then I want it to loop again and give me 4 measurements again from this continuous string of 1s and 0s.
Then I need each of these segments converted into a usable number (aka not binary).
This is the acquesition section of my program with what I have so far... I don't think it's doing the right thing yet, I just pasted in a part of another file I found in the examples to see if I could modify that and get it working.
If any of y'all can help it would seriously make my day!
04-18-2012 10:49 AM - edited 04-18-2012 10:50 AM
Is this what you want? There are also different ways to do this besides string subset
04-18-2012 10:56 AM - edited 04-18-2012 10:56 AM
DOH! easier way.
04-18-2012 10:56 AM
That looks very promising! I can't really tell what some of those functions are, so it's hard to tell... Any chance you could upload a .vi or tell me where some of those functions are located or what they're called? I'm fairly new to this so I don't have a lot of these in my head just yet.
04-18-2012 10:57 AM - edited 04-18-2012 10:58 AM
Look at my second example. It's a better way. The first function is Scan Value, and the numeric constant is an I64. The next is a type cast to an array of I16 numerics. I don't know if you need I16 or U16, but that is something that's easily changed.
04-18-2012 11:16 AM - edited 04-18-2012 11:23 AM
I feel bad, you're being so helpful and I'm still pretty lost. I have everything except for the type and the output of the type cast. Where do you find the things you're using?
And if I have this all right, where is this output going? I've never used that type of output before. Is it like a variable I can call on or what?
Edit: I figured out how to set things as I16 and I64, so that part is a little more clear. I just don't know what the number with the arrows beside it on top of the type cast or the output of the type cast are. I can't seem to find those things anywhere. Here's my version of what you uploaded all by itself.
04-18-2012 02:14 PM
It's an array constant. Just drop one on your block diagram and drag the numeric constant into it. Then right-click the output of the type cast function and choose create indicator.