Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Sensirion SFM3000 via Sensirion USB Stick

Solved!
Go to solution

Issue:

I'm trying to connect to a Sensirion SFM3000 Gas Flow Meter using their USB Stick (made by Code Mercenaries?).  The SFM3000 is an I2C device.

 

Progress:

I can read from the device using the Sensirion software.  I've created a NI-VISA driver successfully.  I can even open and close connections to it without getting an error.  However, I'm getting completely lost with trying to set up the Control Pipe command, even after reading the various posts about it (including the USB nugget 2 series).  The simple version is that I need to send a 0x1000 (4096 decimal) command to the device and then continuously read the data from it until I need to close the connection.  I'm just getting bogged down behind items and terminology.

 

 

I can get/confirm the VISA address using the GetVISAAddresses VI.  I'm trying to use it in the SensirionTry01/02 files, but I think (know) I'm using the wrong read/write VIs for Control Pipe.

 

Can anybody walk me through what the core of the VI should look like (assuming I have the edges correct)?

Download All
0 Kudos
Message 1 of 10
(8,922 Views)

@wlydick wrote:

Issue:

I'm trying to connect to a Sensirion SFM3000 Gas Flow Meter using their USB Stick (made by Code Mercenaries?).  The SFM3000 is an I2C device.

 

Progress:

I can read from the device using the Sensirion software.  I've created a NI-VISA driver successfully.  I can even open and close connections to it without getting an error.  However, I'm getting completely lost with trying to set up the Control Pipe command, even after reading the various posts about it (including the USB nugget 2 series).  The simple version is that I need to send a 0x1000 (4096 decimal) command to the device and then continuously read the data from it until I need to close the connection.  I'm just getting bogged down behind items and terminology.

 

 

I can get/confirm the VISA address using the GetVISAAddresses VI.  I'm trying to use it in the SensirionTry01/02 files, but I think (know) I'm using the wrong read/write VIs for Control Pipe.

 

Can anybody walk me through what the core of the VI should look like (assuming I have the edges correct)?


What in any of their documentation makes you even think that you can even use NI-VISA with this hardware?

0 Kudos
Message 2 of 10
(8,915 Views)

@nyc_(is_out_of_here) wrote:

What in any of their documentation makes you even think that you can even use NI-VISA with this hardware?


Given that their documentation with regard to the Sensirion USB Stick in nearly nonexistent, it seems reasonable that creating a new driver using NI-VISA to talk to the USB end of the connection would be a good first step.  Given that LabView was originally developed to talk to any equipment, it seems reasonable that it can talk to this device.

 

Since your response was less than useless, please elaborate on why you feel that it cannot be done this way.  Include references.  In addition, for extra credit, please provide a reasonable alternative solution if NI-VISA is truly not the correct option.  I've been away from daily LabView coding for 10 years and it's an uphill climb.

 

And, as a reminder, my question was more about how to set up the USB Control Pipe VIs in LabView.  It may be entirely possible that the SFM3000 via the Sensirion Stick cannot talk to LabView.  If that is the case, it will be the first device I've ever seen in 25 years that wasn't able to communicate with LabView but could talk to the host PC.

0 Kudos
Message 3 of 10
(8,886 Views)

@wlydick wrote:

@nyc_(is_out_of_here) wrote:

What in any of their documentation makes you even think that you can even use NI-VISA with this hardware?


Given that their documentation with regard to the Sensirion USB Stick in nearly nonexistent, it seems reasonable that creating a new driver using NI-VISA to talk to the USB end of the connection would be a good first step.  Given that LabView was originally developed to talk to any equipment, it seems reasonable that it can talk to this device.

 

Since your response was less than useless, please elaborate on why you feel that it cannot be done this way.  Include references.  In addition, for extra credit, please provide a reasonable alternative solution if NI-VISA is truly not the correct option.  I've been away from daily LabView coding for 10 years and it's an uphill climb.

 

And, as a reminder, my question was more about how to set up the USB Control Pipe VIs in LabView.  It may be entirely possible that the SFM3000 via the Sensirion Stick cannot talk to LabView.  If that is the case, it will be the first device I've ever seen in 25 years that wasn't able to communicate with LabView but could talk to the host PC.


Hey, it is your time; not mine.

 

Good luck.

 

 

 

 

 

 

0 Kudos
Message 4 of 10
(8,880 Views)
If you don't have good documentation on USB RAW, then why do you think you can create such a driver? You just can't make things up after using the wizard. Where are your references for the low level communication protocol?
0 Kudos
Message 5 of 10
(8,876 Views)

Dennis,

 

I think this is what you're asking about...

 

http://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/GasFlow/Sensirion_Gas_F...

http://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/GasFlow/Sensirion_Gas_F...

http://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Sample_Codes_Software/S...

 

I've seen examples online where people have used the EK-F3 cable to communicate with other Sensirion sensors, but I'm not able to get to the result needed because this is not my area of specialty and I don't know where the first step is.  If I'm on the wrong path, I'm hoping that someone here can recommend a better one.  At this point, I've invested enough time circling this issue that it would probably be worth it to have the customer buy a USB8451 USB-I2C unit from NI and be done with it.

 

0 Kudos
Message 6 of 10
(8,869 Views)
I don't see anything about the usb cable that you have. That is the low level protocol you need to know in order to use VISA RAW. With the I2C description, you could use the 8451.
0 Kudos
Message 7 of 10
(8,858 Views)
Solution
Accepted by topic author wlydick

The customer's 8451 will be arriving today and I should have it in my hands on Wednesday.  I've gotten confirmation from Sensirion that the cable is a no-go.  Their response (edited for space) is below.  Thank you to everyone who put up with my frustration on this.

 


 

SENSIRION RESPONSE:

 

Please note that the i2C interface is not compatible to communicate with Labview, therefore we do not warranty and recommend this because it will not be supported. 

 

I suggested a cable that will convert i2C to RS485 to xxx, and through this you can configure with Labview.  Although, I have not heard from a customer that they have been successful with this process.  We only use this for our liquid flow meters, which has a completely different chip than the SFM3000 flow meter, therefore it will take a lot of modifications along programming to make it work. 

 

Another way to go, would be to use the USB to I2C/SPI/SMBus Interface from National Instruments. You can find this product using the following link:

http://sine.ni.com/nips/cds/view/p/lang/en/nid/202368

Unfortunately it is quite expensive but probably the least effort in terms of drivers and support from National Instruments.

 

Another option to consider is the Arduino based solutions, for example this "Adafruit FT232H Breakout - General Purpose USB to GPIO+SPI+I2C" which you can find here:

http://www.adafruit.com/product/2264

It only costs a fraction but will be more work to get it running.

 

One important thing to keep in mind is that I2C is not intended to operate over long distances. It is known to cause problems if the cables are too long. We therefore recommend to keep the I2C cables as short as possible (<30cm).

Once your sensor is connected to the PC via the NI card they can communicate with the sensor using I2C and the APIs which Labview supplies. A basic tutorial can be found here:

http://www.ni.com/tutorial/5767/en/

and a Labview Waveform Library here:

http://www.ni.com/example/31080/en/

 

Lastly, of course our main recommendation is to use the original communication protocol and that’s the i2C digital interface.

0 Kudos
Message 8 of 10
(8,757 Views)

Low cost

 

Low Price

 

Which is it? a cheep-A$$ dongle, that exposes some poor interface, or, an instrument Plug-n-Pray device?,


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 10
(8,746 Views)

Because I've seen several threads over the course of my search, here is a LLB for my Sensirion SFM-3000 solution.  It uses a NI USB-8451 to communicate with the SFM-3000 rather than the Sensirion EK-F3x cable.  I stole copied from the 8451 examples and worked from there.

 

I have the data running to a Global so that the routine can simply loop but still provide the data to outside VIs.  There's probably a better way to do it, but this works for what I'm doing (so far).

 

Again, my thanks to everyone who helped me out with this.

 

EDIT - enlarged the pics, doesn't seem to have helped much ... Smiley Sad

 

FlowMeter.vi

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FlowMeterWrite.vi

FlowMeterRead.vi

 

0 Kudos
Message 10 of 10
(8,702 Views)