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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot 2's compliment

Solved!
Go to solution

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.

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 1 of 23
(3,247 Views)

The file to choose from the lib s FIFO interface.vi

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 2 of 23
(3,248 Views)

XOR your array with the constant xFFFF.

0 Kudos
Message 3 of 23
(3,234 Views)

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.)

 

0 Kudos
Message 4 of 23
(3,232 Views)

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

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 5 of 23
(3,231 Views)

@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!

0 Kudos
Message 6 of 23
(3,227 Views)

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.

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 7 of 23
(3,220 Views)

@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?

0 Kudos
Message 8 of 23
(3,221 Views)

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.

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 9 of 23
(3,220 Views)

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?

0 Kudos
Message 10 of 23
(3,214 Views)