From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-31-2012 04:06 PM - edited 03-31-2012 04:14 PM
Hi guys,
i have a vi that gives me I32 1D array data out ( Long integer ) ... I want to take the two's compliment of this and plot a waveform.
If anyone needs my VI please feel free to find it in the attachment.
Thankful to everyone who have helped me reach to this point.
Solved! Go to Solution.
03-31-2012 04:30 PM
The file to choose from the lib s FIFO interface.vi
04-01-2012 11:06 AM
XOR your array with the constant xFFFF.
04-01-2012 11:42 AM
I am guessing that you are probably talking about the two's complement. Which is spelled slighly differently.
If you read the wikipedia article, it is clear that your question is very ambiguous, because the term designates how binary values are interpreted as numbers and vice versa. Since you say you have I32, that interpretations is already done and negative numbers are already internally stored as 2s complement.
What kind of data do you actually have and what do you want to get out of it?
(If you habve a 4 byte string, you could just type cast it to I32, for example.)
04-01-2012 11:53 AM
I have something that says
1D array of Long(32 bit integer) as output. now I want to plot these data onto a XY graph that shows the two's complement of the this output.
Thank you
04-01-2012 12:05 PM
@abikutn wrote:
I have something that says
Can you be more specific. What is "something"? (e.g. Technical document? Homework assignment sheet?)
An XY graph needs values for x and y. You only have a single array. What is X? What is Y?
Does the array only contains two values where the first is X and the second is Y?
So far you make very little sense!
04-01-2012 12:42 PM
That is exactly what I want to know. I am sure this 1D array has values for both X and Y. I dont know how it is organised in this array.
As for technical detail. Please find the attached file and FIFO5_interface is the one I am talking about. If you open that VI . You can see the data result in the block diagram.
It is pretty complicated and I dont understand how this 1D array has elements for both X and Y. But if I plot the 2's comp of these values I get my original signal I want. and that is exactly what I need.
Please help me on this.
04-01-2012 12:48 PM
@abikutn wrote:
But if I plot the 2's comp of these values I get my original signal I want. and that is exactly what I need.
Does this mean that you are able to plot them and verify the correct result? If this is true then your problem is solved. Right?
Why do you say you still need help?
04-01-2012 12:53 PM
Yes now we are on track. I am able to plot BUT somehow the resulting waveform is supposed to be plotted in 2's complement format ... That is the only way to get the correct graph.
If I change the waveform graph to decomal, floating , ocatal, hex, binary... It wont result in correct waveform. I need to PLOT it in 2's complement itself.
PS: That is why I am breaking my head so much. There isnt any option in the properties of waveform graph to plot in 2's complement.
04-01-2012 01:33 PM
I think you are confused. Two's complement has nothing to do with formatting.
Can you attach a small picture showing what you mean? How should the graph look like? Do you want the axes formatted in a certain way?