Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

[ModBus] CR1000 <-> Arduino


FRphil May 27, 2013 03:31 PM

Hi everybody,
I'm trying to setup a communication between a CR1000 and an Arduino. I hope I'm not the first one to do that. I'm having issues to write correctly both programs.
Someone has already tried ?
Which solution ? I'm trying to program a Modbus RTU communication program for the Arduino and CR1000.
CR1000 is the Master, Arduino is the slave.
Thank you


ndonso Sep 30, 2013 01:46 PM

I'm interested in doing the same.


FRphil Sep 30, 2013 03:03 PM

This project is still available, but I've abandonned the Idea of coding an SDI12 Library for Arduino, too long... For the moment, Arduino and CR1000 are comunicating by 0-5V, it's not very precise.
Tell me if you find something, I'm interested.


jandujar Oct 4, 2013 03:30 PM

Hello,

I have already done the communication with some microcontrollers such as Fez Panda, Rapberry... with the CR1000. But every time I have employed the Comport port to carry out the communication. It works properly.
Why do you need modbus or SDI12?


FRphil Oct 4, 2013 03:42 PM

I'm building a sensor based on an Arduino, but I need to plug this sensor on a weather station which uses a CR1000.

The CR1000 can "ask" the Arduino-sensor to launch a measurement. The Arduino sends 2 values (numbers between 0 and 1024) everytime he is "asked to measure".

So I need the Arduino to communicate with the CR1000.
Would you use SDI12 or modbus ? Which on is "easyer" to code for such a simple data transfer.

Thank you.


jandujar Oct 4, 2013 04:39 PM

Sorry,

You can use both of them. The point is if you want to use SDI12 or Modbus you have to employ the uart of the arduino (2 pins).
As you know the SDI12 is an old protocol which is not being use anymore. Therefore, I think you should choose the Modbus protocol.

I have developed a sky-camera which is connected to a FezPanda(it is like an Arduino) and then I connect this one with the CR1000 through the comport. The image is sending to the CR1000, it is stored and then sending to a host.

Why don't you want to use RS232 communitation?


jra Oct 4, 2013 05:51 PM

SDI-12 is still being used and developed. You can get the latest (January 2013) specifications from http://sdi-12.org


FRphil Oct 7, 2013 04:01 PM

Actually, I've never tried the RS232 communication, it's easy to code on the arduino side but for the CR1000, I'll try in the next days.
Do you have some simple examples of RS232 code for CR1000.

Thank you


GTProdMgr Oct 7, 2013 04:34 PM

Look at the SerialOpen, SerialIn, SerialInRecord, SerialOut instructions in the CRBasic help. These include sample programs. If the data passed between the two is text, this should be pretty straightforward. If the data is binary, then you have to capture it on the CR1000 side as a string and then do "byte handling" considering each "character" of the string as one "byte".


jandujar Oct 7, 2013 08:30 PM

Here you have a sample:

SerialOpen (Com4,115200,19,0,12010) 'Initialize the COMPORT
SerialFlush(Com4)
Comando=CHR(170)+CHR(170)+CHR(01) 'I send this command to the arduino. An interruption is set up on it.

If(SerialOut (Com4,Comando,"OK",1,100))Then

' If the arduino is able read it, it responds with OK. I set up 100 ms to send the feedback.

SerialFlush(Com4)
SerialIn(envio_tamano_imagen,Com4,200,-1,10)

'The arduino sends the size of the image. Every sending has to be done in less that 200 ms.

FloatValue(1)=ASCII(envio_tamano_imagen(1,1,1))
FloatValue(2)=ASCII(envio_tamano_imagen(1,1,2)) FloatValue(3)=ASCII(envio_tamano_imagen(1,1,3))
long_imagen=FloatValue(1)*65536+FloatValue(2)*256+FloatValue(3)


Maloya Jun 12, 2015 05:29 AM

https://github.com/StroudCenter/Arduino-SDI-12
http://sdiserial-arduino-sdi-12.readthedocs.org/en/latest/

A SDI12 Arduino Libary Have fun.


richr Sep 26, 2016 03:26 PM

All, It looks like this posting is old. I am hoping someone has made some more progress with these issues.

Have anyone been successful using an arduino modbus slave with a campbell Cr1000 logger (as master).   I have been sucessful using a serial connection to send data back and forth reliably but I have only one com port avaiable on my logger and would like to collect data from 6 arduino slaves (they are feedback controllers for elevated co2 chambers).

It seems that the modbus protocol is the only available option for this on campbell. If there is interest, I can share code and such. I have been using the simple modbus slave v10 library but cannot get settings correct between the arduino and logger. I am now thinking that I will need a max232 interface beween them (and use rs232, not TTL).

Roy

  

 

Log in or register to post/reply in the forum.