LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange LabVIEW behaviour passing it a byte array from a c# assembly


@frada wrote:

Hi all,

 

I am experimenting a strange behaviour of LabVIEW (v2011 64bit) when I try to pass it a byte array from a c# assembly written in Visual Studio 2010.

 

The output data type of the c# method I call is correctly defined ad byte[] into the assembly and it is correctly dimensioned and filled by characters acquired from a serial port (when I debug the assembly code, I see that the characters I receive on the serial port are correctly stored into the byte array prior to pass them to LabVIEW).

 

The problem is that, when the array arrives in LabVIEW it appears to be an array of U16 instead of an array of U8 as expected!

 

Is there anyone that can help me with some hint to solve this problem?

 

I am new in developing LabVIEW VIs that talk with c# assemblies and I don't have a sufficient experience to solve this problem; any help will be appreciated.

 

 

 



Is it possible to configure SPI mode using your library? If yes then How?

0 Kudos
Message 11 of 13
(427 Views)

Yes, of course it is possible!

 

In the attached archive you will find the actual version of the BusPirateInterface library DLL and a LabVIEW 2011 demo application to read the temperature reported by a MAXIM's MAX31855 (Cold Junction Compensated Thermocouple-to-Digital Converter); this IC has an SPI digital interface to the external MCU/MPU and with the attached VI and a Bus Pirate I am able to read and display both the hot and the cold junction temperature registers.

 

You can take a cue from this code to see how to setup the SPI binary mode of Bus Pirate using my library.

 

Regards

 

0 Kudos
Message 12 of 13
(419 Views)

Thanks Buddy, However looking your code it look like data reading.

 

I am follwing below steps for configuraing the BUS pirate as SPI mode using simaple VISA vis (RS 232):

 

m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
9. DIO
x. exit(without change)

(1)>

Set speed:
 1. 30KHz
 2. 125KHz
 3. 250KHz
 4. 1MHz

(1)>

Clock polarity:
 1. Idle low *default
 2. Idle high

(1)>

Output clock edge:
 1. Idle to active
 2. Active to idle *default

(2)>

Input sample phase:
 1. Middle *default
 2. End

(1)>

CS:
 1. CS
 2. /CS *default

(2)>

Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)>

Ready
SPI>
Sniffer
Any key to exit

 

Any way : does your Temaprature sensore(MAX31855) behave like slave device?

 

 

0 Kudos
Message 13 of 13
(415 Views)