ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1's complement with Hex string conversion


@GerdW wrote:

Hi bala,

 

what about using an AND gate of 0x1FF to catch the 9 LSBs? Instead of the current 0x1F, which only gets 5 LSBs...


Don't know where my other "F" went.  Thank GerdW.

 

 

0 Kudos
Message 11 of 16
(3,983 Views)

According to section 3.1 of the document you posted here in this thread the attached code will generate a formated frame.

0 Kudos
Message 12 of 16
(3,964 Views)

Thank you very much for the answers now i am able to get the 1's complement correctly by adding 1FF to the AND gate.

 

I am attaching the manual with this post please have a look.

 

regards,

 

Bala

0 Kudos
Message 13 of 16
(3,950 Views)

bala1234,

 

The attached vi is based on information from the instrument manual.  I noticed that the message format calls out for the 'Cks' to be transmitted as two ASCII characters.

0 Kudos
Message 14 of 16
(3,931 Views)

@Wayne.C wrote:

bala1234,

 

The attached vi is based on information from the instrument manual.  I noticed that the message format calls out for the 'Cks' to be transmitted as two ASCII characters.


That is very similar to my version posted above.  I was going to point out that your array sum will not handle roll over situations but then I realized that it doesn't need to.  Only the last byte is used anyway so my extra numeric conversions to U32 and back to U8 in my code is unnecessary...

0 Kudos
Message 15 of 16
(3,924 Views)

paulmw,

 

Sorry I'm running LV8.6.1 and couldn't view your vi.  Sounds like our friend has a couple of vi's to try now.  Smiley Happy

 

0 Kudos
Message 16 of 16
(3,911 Views)