Vai al contenuto

Send an ascii string that reports a digital input status

Home Forum Programmazione IEC 61131 (LogicLab) Send an ascii string that reports a digital input status

Stai visualizzando 6 post - dal 1 a 6 (di 6 totali)
  • Autore
    Post
  • #35281
    Kostas
    Partecipante

    I’m trying to write a simple program that sends the status of digital inputs out to the serial line. My need is to manage 48 digital inputs using 3 PCB124*000 modules connected to a SlimLine CPU module.

    The request is to send a string, out to the serial port (9600, n, 8, 1), every time one of the inputs changes its state. The string must contains the status of all the inputs. As example the strings can be like these:

    *010000000000000000000000000000000000000000000000# //Digital inp01 is On
    *010000001000000000000000000000000000000000000000# //Digital inp01 and 08 are On
    *000000000000000000000000000000000000000000000000# //All digital inputs are Off

    Can someone help me ?

    #37407
    Sergio Bertana
    Amministratore del forum

    I’ve create a simple program for you, this program acquire the digital inputs from the PCB124*000 modules. The acquired status is compared with the saved one and when one or more of the inputs change its status, a message is sent out from the serial line.

    The program is documented so it’s simple to follow its flow, anyway if you are in trouble you can post the requests in the forum. Here the program printout and the complete source code.

    #37412
    Kostas
    Partecipante

    Thank you for the program! Unfortunately I can’t load it in the SlimLine. When I try to download on it I get the error:

    Processor setting error: current project ‘ARM9’, target device”.
    Comm setting error: current project ‘ELS20’, target device”.

    Do you have any suggestions on how to overcome this problem?

    #37413
    Sergio Bertana
    Amministratore del forum

    The cause of the error is that you are connected to the SlimLine thru the serial line, and probably you have not the correct cable or the proper serial settings.About the cable you must use our CBL054*000 adapter with the CLB057**00 extension cable, if you don’t have you can do them by yourself (Refer to drawing).On LogicLab you must define as serial settings 115200, e, 8, 1 and the modbus node must be 1. The COM port you define, is the COM used on the PC regardless the COM port number of the SlimLine (Refer to picture).Please note that if you don’t have the SD Card inserted you not have the space to contain the program source code, so you must disable the Source code download tick otherwise a warning message will appear and the program is not downloaded on the SlimLine. warning T8209:  No room for source file on the target.

    Attention! The program treated in this topics uses the SlimLine COM0 serial port to send out the digital inputs status, so to connect LogicLab, the serial line COM1 must be used.

    #37423
    Kostas
    Partecipante

    I tried to access the code of SetSMode and VBitTest but they seem to be encrypted. Could you please provide the password or the code ?

    #37424
    Sergio Bertana
    Amministratore del forum

    All the Functions and FBs we provide as a standard libraries are crypted, this prevent user to modify them. For some of them we don’t release the source code, but many of them are really very simple and there is no problem in to release the source code.

    Understanding the source code is a good way to enter deeply in the SlimLine programming tecniques, here the SetSMode and VBitTest printout, unfortunately all the comments are in Italian.

Stai visualizzando 6 post - dal 1 a 6 (di 6 totali)
  • Devi essere connesso per rispondere a questo topic.