I have an EtherCAT module that has both inputs and outputs on it. It seems like the scan engine module can only handle it if you include only the Inputs or only the Outputs in the channel list. Seems like this could be related to the changes where now the module attempts to read multiple channels at once instead of individually as it once did. I have looked at the scan engine module runtime code but haven't had the time to debug this issue. Has anyone seen this issue happen on modules like the NI 9375? If not, it could be something to do with how the address string is --- ni.var.io://localhost/Mod1 vs. ni.var.io://localhost/EtherCAT Master/Device ?
Do you have the latest version of the DCAF Scan Engine Module?
I think this is the issue you are referring to: https://github.com/LabVIEW-DCAF/Scan-Engine-Module/issues/62
Which I believed I solved in: https://github.com/LabVIEW-DCAF/Scan-Engine-Module/pull/65
It was a while ago but I think I had changed the code to check if the container had variables with more than one datatype. If it did, then didn't go with batch read/write but individually channel by channel. I am not quite sure if I tested it with a module that was bidirectional though.
yep I do have the latest installed. Works fine with mixed-type modules. I am going to see what I can do inside "Scan engine runtime.lvclass:create module map.vi" to fix it and report back. If it works I'll do a pull request then.
Ok, I believe I have a solution. Look at the variables for a module. All variables will be readable, AFAIK, whether they write to a physical output or input, so that doesn't matter. For a given module, ALL variables must writeable (pure output module), OR NONE must be writable (pure input module). This condition, and the condition that all datatypes for the module must be the same, determines whether batch writing is allowed. I tested this with mixed input/output beckhoff module and I can control the outputs and read inputs through DCAF
BTW should I explicitly close those shared variable refs? They were never explicitly opened but I don't know the subtleties of it
This issue burned me using the NI 9375 module, half DI and half DO. I tried the same code change and it is working now.
Brand new to DCAF, this ate a chunk of time. Many thanks, MarkCG!
happy to hear that Jeremy! BTW do you have any opinion on whether I should explicitly close those shared variables refs? Does it make any difference? I was waiting to do a pull request pending feedback on that