- Rslogix Copy Int To Two Bytes Number
- Byte To Int Java
P: n/a | Fore wrote: On 11 Sep, 21:31, red floyd <redfl...@gmail.comwrote: >On Sep 11, 12:56 pm, Fore <brian.william...@blueyonder.co.ukwrote:
>>Hello I am looking for some effecient way to convert a 32 bit unsigned integer to a 16 bit signed integer. All I want is the lower 16 bits of the 32 bit unsigned integer , with bit 15 (0..15) to used as the sign bit for the 16 bit signed integer. Any ideas/help greatly appreciated. 1. Remove the word 'efficient' from your lexicon. Study Knuth's/ Hoare's law. 2. Have you not studied the bitwise operators? Answer to 1. I accept removal of efficient and no to ...laws. Answer to 2. is yes, but I also want to be able to achieve this without a host of complier warnings about the possible loss of data. If compiler warnings bother you, disable them. Going from 32 bits to 16 bit *will cause* loss of data (the top 16 bits), the compiler cannot let it go without a warning *unless* you tell it not to warn you. V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, please don't ask |
|
Rslogix Copy Int To Two Bytes Number
Byte To Int Java
How to communicate to an Allen Bradley Plc with C# and LibPlcTag Ethernet/IP library in Allen Bradley, C#, PLC Drivers 43 Comments 23,029 Views LibPlcTag is a library that I used recently to communicate with Allen Bradley plc.