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
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:


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


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


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


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:


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