取消
显示结果 
搜索替代 
您的意思是: 

Convert a normal number to binary?



@C. Minnella wrote:
Really minor, but I think I would replace the Quotient & Remainder with a divide, and you could even use a floating point type for the speed control.
Well, I figured rounding down to the neares 0.1 rpm out of 20000 rpm would not make much of a difference ;). I don't think we need anything orange here. 😄
0 项奖励
101 条消息(共 129 条)
1,462 次查看
So I converted the displays over to I64.
 
And I know this may be the same time I have made the same mistake and asked about it for the millionth time in this thread but i still just dont "get it" im sorry.
 
1. You guys all mentioned custom probes. I searched the help file and it mentions custom probes, but I still cant figure out how to make one.
 
2. Im thinking it may be the probe im using but let me ask this anyway: The response form the controller consists of "twos compliments" or one large number consisting of one bit for the first digit and one bit for the second digit correct? I have examined the answer string in hex and I have identified which "indexes" are the bits I want to grab, reform into one 2 bit number, multiply by a scaling multipler, and then dispaly in decimal.
 
So i look with the standard probe at what it is produced AFTER the string to byte array block. They seem to be 0-255. Now im resonably sure this is because its an 8 bit number.  Im not really sure what the difference is between a U8, I8, etc. Now it does seem that when I join the numbers that it dosent quite work, but how can I really know if the probe is not in the right units?
 
Help me out here.
0 项奖励
102 条消息(共 129 条)
1,433 次查看
To create a custom probe, right-click on the wire and select "custom probe...new..." base it on an existing probe, but change the display to the desired format.
 


@Vr6Fidelity wrote:
So I converted the displays over to I64.

Why??? I32 is sufficient.


@Vr6Fidelity wrote:
 Im not really sure what the difference is between a U8, I8, etc.
Now, that's really a prerequisite for any programming job of this flavor. Maybe you want to relax over the weekend and do some easy reading on programming fundamentals. "I" is a signed integer,meaning the first bit distiguishes between positive and negative, while the remaining bits are the number, U is unsigned. 8 is the total number of bits.
 
I8 can be in the range of -128...127
U8 can be in te range of 0...255
 
If you join numbers, the possible sign only makes sense for the higest byte. If things are expected to be little endian, you need to reverse the bytes. You simply need to start thinking on a bit level. It is really simple: only two states each!
 
Under the hood, everything is just a collection of bits. Only you know how they need to be interpreted. (For example if you have 32 bits, it could be a string with 4 characters, an I8 array with 4 elements, a U16 array with two elements, A I32 integer, A SGL floating point number, A cluster of two U8 and one I16 numeric, etc.etc. mix& match!)
 
Here's a good start:
 


 

Message Edited by altenbach on 08-03-2007 08:12 AM

0 项奖励
103 条消息(共 129 条)
1,429 次查看

The numbers still add up to crazy high values like for example the speed at 30,000 reads 532,000 or so.

 

 

0 项奖励
104 条消息(共 129 条)
1,415 次查看
Can you show us the raw response string you get and number you want to get out of it.
 
Maybe you need to do a factor of 10 here too?
Maybe you need to swap the bytes?
 
 
0 项奖励
105 条消息(共 129 条)
1,404 次查看

Everything is working now, thanks to all of you. 极度高兴的表情

 

 

0 项奖励
106 条消息(共 129 条)
1,394 次查看

Quick question, Everything is working well now and I am very pleased.

The voltage value that I am reading is changing a 2KHZ and since I am sampling it at the relativly slow speed of 4S/Sec It is a bit "Jittery"

I would like to make a running average of the last 10 samples. I know I need to use a shift register somehow, build an Array, sum the array elements and then divide by the number of array elements.

How do i make an array where the new value written "bumps" the bottom value out of the array?

I was thinking something along these lines? How do i make it have 10 points and the bumping action?

0 项奖励
107 条消息(共 129 条)
1,386 次查看
If you have the full version of LabVIEW, you can just use the Point by Point Mean function.
0 项奖励
108 条消息(共 129 条)
1,377 次查看
Im just a lowly base customer.  难过表情
0 项奖励
109 条消息(共 129 条)
1,372 次查看
I broke it. 难过表情
 
I SWEAR I touched nothing!!!! I just pasted this into my other data quisition VI and poof, something went south with the event structure. How do I fix it?
0 项奖励
110 条消息(共 129 条)
1,363 次查看