Post Go back to editing

Serial connection RS485 with EVAL-CN0359-EB1Z Rev. A

Category: Software
Product Number: CN0359 Conductivity Measurement System

Good afternoon,

I am trying to get the measurement of the conductivity using a serial connection RS485 and a ASCII protocol. The problem is that, using the command 'poll' the string given back is too big for the function on the program I am using to read ( it only read half of the response) and I need a way to have, using a command, as an answer only the measurement of the product, and not also the setting so that my program (openPCS of Ascon technology) can fully read the measurement.

 

Thank for your time, Angelo

  • Hi Angelo,

    I would just like to ask a few questions to further understand your issue:

    • What serial terminal program are you using? (Putty, TeraTerm, HTerm, etc.)
    • What are your serial terminal settings? (baudrate, star and stop bits, etc.)
    • For a Rev A board, according to the CN0359 Analog Wiki User Guide , we are supposed to send the the RS-485 address first before the actual command. For example, if the RS-485 address is set to 100, the command that is supposed to be sent to the boars is: "100 poll". Can you please help verify if this is what you also do?
    • Can we also please have a photo of your current hardware setup if possible?

    Thanks and regards,
    Andy

  • Hi Andy,

    thank you for you fast response.

    Serial terminal program: OpenPCS of ascon technology. 

    The serial terminal settings are:  Baudrate: 115k (115.2kbps), port communication stop bits: 1,port communication parity: none, port communication data lenght: 8.

    Yes, i do that, with address 100 and writing "100 poll". I do send it and I do have an anwer back, my issue is that i cannot read it until the end because of the function that I used in the program (that cannot be changed) does not read longer texts than around 200 characters. That is why for me it would be helpful to have only the measurments as an answer.

    The CN059 is connected with a vP4 ( a multiloop programmable automation controller with integrated HMI), of Ascon Technolgy, directly via the RS485 connection. The vP4 is then connected to my program in Open Pcs (also of Ascon Technology) with an Ethernet/MODBUS connection. I did use for testing before a direct connection with the CN359 and my PC using an adapter RS485/RS232 to USB and aother program to read/send the input to/from the CN359 called "AccessPort". In that case i did have as an answer the full query of the program up to the conductivity measurement. The picture is as clear as I could, sorry for that.  

    I hope to have answered fully your question.

    Thanks and regards,

    Angelo

  • Hi Angelo, 

    Thank you so much for providing the details. 

    To modify the printed characters when the "poll" function is entered, you would have to try and modify the CN0359 Rev. A source code which can be found here

    Specifically, lines 55-119 of the cmd_poll.cpp file define the output for the "poll" command. You can modify this section based on what will work on the requirements of your setup and to customize what is displayed in your serial terminal.

    To build and debug the code, you will need CrossCore Embedded Studio and a J-Link debug probe (or a similar programmer) to program the CN0359 board. More details on the software setup can be found here: https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/CN0359#software_programming

    Let us know if you need further assistance.

    Regards,
    Andy