Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Reading serial data from turbine controller

Options
  • 13-01-2023 2:11am
    #1
    Registered Users Posts: 5



    Hello, I’m trying to figure out how to read the data from my wind turbine controller. I would like to read it using python as possible to use the data as variables in a script.

    Right now it connects to my pc and shows the data using the program that came with the device. It connects to the pc com port at 2400bps displayed in the program but windows shows 9600 , not sure what’s up with that.

    It uses a Rs232 to usb adapter for connection. The only thing it says in the manual about it is this: RS232 (5V level ) ( standard)

    When I use pyserial or terminal in windows I never get any data from it to view.

    Any suggestions on how to get the data?




Comments

  • Registered Users Posts: 3,868 ✭✭✭ozmo


    Ignore that windows setting - its overwritten when you use code or app.

    Note also only one app can access a com port - so you need close any other app trying to access it.

    This is not optimal - but might get you started...


    import serial, time
    
    ser = serial.Serial('COM6', 2400) # comport and baud set here - other "n,8,1" settings are already the default
    
    while 1:
        serial_line = ser.readline()
    
        print(serial_line)
        # Do some other work on the data
    
        time.sleep(1) # sleep if required
        # End Loop
    
    ser.close() # Only executes once the loop exits(in this example - never)
    


    “Roll it back”



  • Registered Users Posts: 5 SlvrSky07


    Thanks for the reply, I used the code but it just gets a blank output.

    I also tried it on a raspberry pi (changing it to /dev/ttyUSB0 of course) same outcome.

    The controller should just be transmitting the data with out a command from the program correct?

    The windows program gets the changes in voltage from the controller about every second so I’d think I’d see some kind of output.



  • Registered Users Posts: 5,991 ✭✭✭kirving


    Generally, you would need to interrogate the controller to get a response from it, so the program is likely doing that in the background.

    For the controller, is there a list of available commands published? If not, can you use something like below to capture the comms going back and forth so you can replicate yourself? https://www.eltima.com/products/serial-port-monitor/



  • Registered Users Posts: 5 SlvrSky07


    I was thinking it has something to do with that. I am familiar with modbus polling so I thought I might need a register chart of some sort for this. I do not have any commands for it, the manual was hard enough to get from the manufacturer and I doubt they would release any other information.

    With using the monitor program would it display the commands and response in plain text or binary/hex?



  • Registered Users Posts: 5 SlvrSky07


    It looks like the data keeps repeating itself. Could you tell me where to start with this data?




  • Advertisement
Advertisement