Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: io_bus_card_readissue

io_bus_card_readissue 3 years 11 months ago #10593

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
Hi Claes,
I'm currently writing a new communication driver and am encoutering an issue I've never faced before.
Indeed, my issue is between the Proview signal Ii / ChanIi and the driver input area zone.

My communication tests look fine and I can retreive correctly the data from my external PLC into the local->input_area which is declared as
unsigned char   *input_area;
in the local card structure.
All the input area is good matching in term of values and size

My problem come when I call the:
io_bus_card_read(ctx, rp, cp, local->input_area, NULL,  local->byte_ordering, local->float_representation);

function in my cyclic IoCardRead function.

What happen is that the two first byte (correspond to the first Ii signal (UInt16)) are not transferred to the related Ii signal whereas all the other signals (I tested with 9 signal from 1 to 9 and signals 2 -> 9 are fine). There is no shift at all and the second signal corresponds correctly to value 2 and so on.

I thought about a pointer issue that could erase or rewrite this data area but writing into the Ii signal by hand though rt_rtt reveals that this values is not overwritten by anything (it keeps the values I set by hand at every change).

Note: The ConversionOn is correctly set to 1 in the ChanIi and I reconnection twice the Ii to the ChanIi to be 100% sure.

Would you have any idea what could prevent this first data of being transferred ? Would you have any idea how to troublesoot this ?

Thanks a lot in advance
Snarf
The administrator has disabled public write access.

io_bus_card_readissue 3 years 10 months ago #10598

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi Snarf,

The two things that would prevent writing the signal value is that ConversionOn is not set, or the signal/channel connection is not correct. If you look in SigChanCon in the channel object, can you see the correct signal there? Is there any error message from the IO initialization in the log file?

One way of troubleshooting is to start the plc in debug and set a breakpoint in io_bus_card_read().

/Claes
The administrator has disabled public write access.

io_bus_card_readissue 3 years 10 months ago #10622

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
Hi Claes,

Thanks for answer.

Unfortunately as I mentioned in my original message:
"Note: The ConversionOn is correctly set to 1 in the ChanIi and I reconnected twice the Ii to the ChanIi to be 100% sure."

So I can't find any mistakes of that kind.

I neither see any particular clue in the log file.

Let's try with gdb if I still succeed in using it...


[EDIT] Indeed, it appears my chanIi is connected twice. Once with the Ii I'm expected and another connection with a previous Ii that I don't make use anymore at the moment. I didn't know two connection were possible for the same signal channel. I can't test this assumption at the moment because my target is out of reach but I will confirm it is the root cause asap.


Snarf
Last Edit: 3 years 10 months ago by Snarf77.
The administrator has disabled public write access.

io_bus_card_readissue 3 years 10 months ago #10625

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 847
  • Thank you received: 2
  • Karma: 5
Problem solved.
The issue was linked to the double connection of the ChanIi
Thanks for your help
Snarf
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.727 seconds