04-02-2013 12:22 AM
I had attached one VI which is the had the termination commands for the motor.The motor will provide the steps it ran only after giving the termination commands. in these the commands from 165-167 will provide the decimal numbers ie eg outputs for the commands which represents 50000 steps is given below
165--00
166--195
167--50
from 168-170 it will provide zero since i'am not using those axis
so how can i modify the program to get the respective step counts from the component numbers. Please kindly help me.
04-02-2013 01:21 AM
How's this?
/Y
04-02-2013 04:07 AM
here can you tell how the type cast function with the array subset provides the decimal number of length more than one byte from these three numbers. You gave 2 and 3 to subset array terminals. From the index 2 onwards 3 indices will be selected. but these three numbers , how they are joined and get a another number using type please explain if you re free to do.
04-02-2013 04:41 AM
50000 written with 3 bytes is 00 C3 50 (00, 195, 50), and your return is an array of U8, or single bytes.
So, extracting those 3 bytes as an array of U8, and typecast it to a I32 you get 0000C350 (possibly with a byte order issue, you'll have to test that)
It's easy to show if you make a test vi with an array of U8 and typecast it to a I32 and show all as hexadecimal.
/Y
04-02-2013 04:54 AM - edited 04-02-2013 04:57 AM
Hi perumpadapu,
why did you start a new thread instead of continuing in your old one?
Try this:
Get your 3 bytes, prepend a zero, typecast to I32. Your example yields 49970 instead of 50000 (50000d = C350h, but 49970d = C332h)...
Or use Join as suggested in your older thread...
04-02-2013 05:08 AM
but i need the final value as a decimal number. Is it possible with it? please kindly reply on available free time
04-02-2013 05:28 AM
Blue threads are integers, decimal numbers.
/Y
04-02-2013 05:28 AM
I attaching a test VI for 50000 , but your solution never give the adequate result
04-02-2013 05:33 AM
Gerd is right, you need to add an additional 0 byte to the start of the array.
/Y
04-02-2013 05:48 AM
Hi perumpadapu,
that's what you created:
Does it look like my example? Did you tried to debug that using highlighting?
Why did you insert that ArraySubset function? Why did you try to get bytes 1,2, and 3? From an array that only contains values at index 0,1, and 2?
Do you sometimes think before you start programming?
Do you sometimes read other peoples answers to your questions?
So many questions...