LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can someone tell me how to reverse the bit order of an .hws file?

Solved!
Go to solution

I have a .hws file (digital) that is backward.  I need to swap the LSB and MSB to reverse the playback order.  Can anyone tell me how to do that? 

0 Kudos
Message 1 of 12
(3,330 Views)

Are you asking for bit order or byte order?  I'm going to assume byte order since you message says swap MSB and LSB and not bit order which would not make sense for a file system.

 

If you read in the file as binary data, let's say with U16, you can use the Swap Bytes function and write it back out as a binary file.

0 Kudos
Message 2 of 12
(3,327 Views)

Jallen, 

 

Here's a link that you must read if you havent already.

http://zone.ni.com/devzone/cda/epd/p/id/1758

 

Does this help?

 

Regards

Prashanth N
National Instruments
0 Kudos
Message 3 of 12
(3,326 Views)

Specific to your problem, you just treat it as a binary file, and then you can swap bytes easily with the functions pallette.

 

Regards,

Prashanth N
National Instruments
0 Kudos
Message 4 of 12
(3,325 Views)

I have a digital WDT file with 7 signals.  I need the end of the waveform to be the start. 

0 Kudos
Message 5 of 12
(3,322 Views)

Does that mean that you want the whole waveform data reversed? Starting from the last data and ending with the first?

Or, does it mean that you want to swap bytes/bits for each data?

Prashanth N
National Instruments
0 Kudos
Message 6 of 12
(3,319 Views)

whole waveform reversed

0 Kudos
Message 7 of 12
(3,315 Views)

The solution still stands.

Read the file as a binary file. Read out the bytes and write them back in reverse order.

 

Does it help?

Prashanth N
National Instruments
0 Kudos
Message 8 of 12
(3,313 Views)

can you give me an example of this?  I have attached a file that I'm trying to reverse. 

0 Kudos
Message 9 of 12
(3,299 Views)

Jallen,

Refer to this document to convert your hws file to an lvm format.

http://digital.ni.com/public.nsf/websearch/396B0B404275CEDB862571DE005250EA?OpenDocument

You can then read the measurment file using the express VI and extract the data.

After you extract the data we can easily reverse it and write it back.

 

Regards,

Prashanth N
National Instruments
0 Kudos
Message 10 of 12
(3,291 Views)