1-wire implementation in C#-code / Using U6 and CB15 | LabJack
 

1-wire implementation in C#-code / Using U6 and CB15

2 posts / 0 new
Last post
PEDS.LI
office@peds.li's picture
1-wire implementation in C#-code / Using U6 and CB15

Hello, my customer is using an u6 device with the cb15 extension. He would like to measure temperature by a 1-wire temperature sensor (Type: DS18B20+). Are there any code snippets to read out 1-wire sensors in C#?. Many thanks for your answer.

LabJack Support
labjack support's picture
We do not have a 1-Wire C#

We do not have a 1-Wire C# example for the U6 and the UD driver doesn't have specific functionality for it. Low-level command-response is needed for 1-Wire functionality. The command-response are byte arrays you send and receive. In the UD driver you use the RAW IOTypes (LJUD.IO.RAW_OUT and LJUD.IO.RAW_IN in C#) to send/receive the byte arrays:

https://labjack.com/support/datasheets/u6/high-level-driver/example-pseu...

Our C# examples can be found here and will help with general usage:

https://labjack.com/support/software/examples/ud/dotnet

The 1-Wire low-level command-response is documented here:

https://labjack.com/support/datasheets/u6/low-level-function-reference/1...

1-Wire is an Extended command with a Checksum8 and Checksum16:

https://labjack.com/support/datasheets/u6/low-level-function-reference/g...

Although it is for a different driver, we do have some C/C++ code for calculating the checksum for a command byte array which will help:

https://github.com/labjack/exodriver/blob/master/examples/U6/u6.c#L60

Last, we have a 1-Wire app note here:

https://labjack.com/support/app-notes/1-wire