From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

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,062 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,059 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,058 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,057 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,054 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,051 Views)

whole waveform reversed

0 Kudos
Message 7 of 12
(3,047 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,045 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,031 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,023 Views)