LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2’complement hex convert

Solved!
Go to solution

Aojha wrote:

Although I would like the person posting the question to arrive the solution by himself through disscussions.


The problem was that your discussions were leading the the person into a deep swamp, making the solution appear much harder than it actually is. 😮

Message 31 of 40
(1,921 Views)

Let me make myself clear,

any signed bit is +ve if msb is 0 and -ve if msb is 1. I did not type casting and flattening dunction at that time. But I knew How to use msb information to get a solution. So i suggested to use string functions to swap bytes.

I agree your solution was simple and good.

Labview user
Message 32 of 40
(1,895 Views)

Hi ,

In your vi I tried to modify the values in Array of strings. But could not do so.

If I creat additional control then I can modify it. How could I achieve this so that no one can modify the inputs?

Labview user
0 Kudos
Message 33 of 40
(1,890 Views)

hi, I tried to read a file and Unflatten it to a Waveform but got this error. I am getting same error even if I am reading a .dat file through read binary file.

 

See the attachement

Labview user
0 Kudos
Message 34 of 40
(1,883 Views)

@Aojha wrote:

hi, I tried to read a file and Unflatten it to a Waveform but got this error. I am getting same error even if I am reading a .dat file through read binary file.


This question seems unrelated to this thread - why post it here?

 

But your problem is that you do not understand the difference between text and binary.  The file is ASCII text (the data indicator is human-readable); unflatten from string expects binary data.

0 Kudos
Message 35 of 40
(1,880 Views)

HI,

I also tried with .dat file and read from binary file but got same error

Labview user
0 Kudos
Message 36 of 40
(1,876 Views)

You shoud really start a new thread with this unrelated question. This thread is already marked as solved!

 


Aojha wrote:

I also tried with .dat file and read from binary file but got same error


You are not providing any information. ".dat" is just a generic file extension, and gives a absolutely no useful information on how the file is structured. Where does the file come from? Who wrote the file? How was the file initially written?

If you want help, attach an actual data file as well as the VI that gives you the error. But first start a new discussion thread!

 

In fact, your last posts are all pure gibberish and make absolutely no sense:

 


@Aojha wrote:

Let me make myself clear,

any signed bit is +ve if msb is 0 and -ve if msb is 1. I did not type casting and flattening dunction at that time. But I knew How to use msb information to get a solution. So i suggested to use string functions to swap bytes.


You are not making yourself clear. I am not familiar with the abbreviations -ve and +ve. The problem was not msb, but 2's complement. Appanrently you were unaware that the binary reprensentation is 2s complement already.


@Aojha wrote:

Hi @altenbach,

In your vi I tried to modify the values in Array of strings. But could not do so.

If I creat additional control then I can modify it. How could I achieve this so that no one can modify the inputs?


You are not explaining what you tried to modify. What kind of "additional control"? Modify what (what is "it")? Achieve what (what is "this"?). Do you have problems creating a diagram constant?


@Aojha wrote:

hi, I tried to read a file and Unflatten it to a Waveform but got this error. I am getting same error even if I am reading a .dat file through read binary file.


Your attempt shows that you have absolutely no idea what unflatten actually does. did you even read the help? You can only unflatten to a waveform if the file actually contains a flattened waveform. Your file is formatted text, nothing flat or binary at all.

 

Unflatten from string is not some magical block that can read your mind and digest whatever you throw at it. It is the opposite: You need to know exactly how the string is structured.

 

 

 

0 Kudos
Message 37 of 40
(1,867 Views)

I will start a new thred for other question. but one thing is related to your posted vi. Here I could not modify values in string (hex display). How to achieve this?

see the attachement

 

Labview user
0 Kudos
Message 38 of 40
(1,860 Views)

How did you try to modify the value?

What happened instead?

Modify to what new value?

Since the string is in hex display, it will only accept numbers 0..9 and letters A..F, so don't try to enter random text.

 

You really need to formulate your posts with more useful information. There are millions of possible ways something does not work and if you don't tell us the details, we cannot help.

0 Kudos
Message 39 of 40
(1,854 Views)

OK I got it.

Thank you

Labview user
0 Kudos
Message 40 of 40
(1,851 Views)