Menu

writebytes problem with PIW

Help
Karol
2013-08-29
2013-09-11
  • Karol

    Karol - 2013-08-29

    Hello,

    I've just started using libnodave - this is great tool indeed.

    Anyway I've got problem with write value of analog input in simulation program tested at ET200S (IM 151-8, working like S7-300). I use also nettoplcsim for simulating SCADA on second PC.
    I can read and write DB and M values, but I've got problem with PIW. Manually changed value of PIW400 in PLCSIM works fine.

    Below I attached code, which with I try to overwrite value of PIW400 - I've tried also to write values converted from integer to array of bytes with 'GetBytes' and then reverse it. Suspending it may makes some unacctepable value for PIW I decided to write value of 0 or 1, 2 etc. in array prepared manually. The code below lets me to write value to word in DB after changing for daveDB and it works fine as well.
    All in all many tries and searching web for help without success - value is not written, so I would be really thankful for any advices.

        Dim doWpisania(1) As Byte
    
        doWpisania(0) = 0
        doWpisania(1) = 1
    
        dc.writeBytes(libnodave.daveP, 0, 400, 2, doWpisania)
    
     
  • Anonymous

    Anonymous - 2013-08-30

    This is not a fault of libnodave or your program, it's just a limitation by design of the S7 communication protocol. In case of "daveP" addresses, you're reading from an input (PIW400 in your example), and you're writing to an output (POW400).

     
  • Anonymous

    Anonymous - 2013-08-30

    This is not a fault of libnodave or your program, it's just a limitation by design of the S7 communication protocol. In case of "daveP" addresses, you're reading from an input (PIW400 in your example), and you're writing to an output (POW400).

     
  • Karol

    Karol - 2013-09-11

    Thank You for answer.

    So it seems like there is no other option than use other variables saved in DB for example and use them instead PIW in project simulation. My plan was to simulate all including analogue inputs, but if there is problem like this it's going to be only way to use other variables for simulation case.

    Lucky me to can change the Siemens project - it's real problem when somebody can not do it.

    Best regards!

     

    Last edit: Karol 2013-09-11

Anonymous
Anonymous

Add attachments
Cancel