LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

32 bit representation of a 32-bit device address

Hi,

I am querying a hardware device which has a specific 32-bit address (for e.g. "1.6"). But when I query the address, I receive the address as a 32-bit signed integer. How do I interpret this integer to tally with the actual address value? Is there any section on the NI website, where I could read up the fundamentals of 'bit' mathematics?

-Dude
0 Kudos
Message 1 of 5
(3,051 Views)


@cincidude wrote:
Hi,

I am querying a hardware device which has a specific 32-bit address (for e.g. "1.6"). But when I query the address, I receive the address as a 32-bit signed integer. How do I interpret this integer to tally with the actual address value? Is there any section on the NI website, where I could read up the fundamentals of 'bit' mathematics?

-Dude



32-bit addresses are typically unsigned integers, so I am not sure how you come up with a noninteger value such as "1.6". Just typecast your I32 to U32 and you should be all set. No fancy bit mathematics needed. 😉

In what form do you receive the raw data from the instrument? Where in the code does it turn into a signed integer. Maybe you can change things around so you get the U32 right away?

See how far you get. If I misunderstood, please attach some simplified code.

0 Kudos
Message 2 of 5
(3,040 Views)
I'm not sure if we are on the same page. I'm using the call library function node to query the serial port. The documentation for the device states the following:

"ibApi_GROUPID
    struct ibApi_GROUPID_s {
    ibApi_UINT8 words[ibApi_GROUPID_SIZE];
    };
typedef struct ibApi_GROUPID_s ibApi_GROUPID;

The group ID is a 32-bit address that is used to identify a specific network of devices and is shared by all the devices within the network. The API functions are standardized to return the value ibApi_RESULT, which is a signed 32-bit integer."

Now the device has a hardware address written on it ("1.6"). And when I query the device, I get the device address as a 32-bit integer, as inferred from the documentation above (I even tried UINT8 for that matter). I want to confirm if these values that are being returned are indeed the hardware address of the device.
0 Kudos
Message 3 of 5
(3,035 Views)
Addresses are integers. Are you sure that the '1.6' is a hardware address? It sounds more like a revision number (hardware or firmware). What does the vendor say?
0 Kudos
Message 4 of 5
(3,018 Views)
You are absolutely right. You cannot really call it a hardware address. Its more like an ID that the device can be associated with. It can be changed using the application provided with the device. I'm using API calls using LV to query this ID. The API is designated to return the ID in the form of a 32-bit integer (Or so I suppose).
0 Kudos
Message 5 of 5
(3,012 Views)