kkoen Posted December 11, 2019 Share Posted December 11, 2019 Hi there, Thanks for the support i received in the past, I have a few years of positive experience with azeotech. In my current project i deal with a modbus device. Reading the registers works ok, I have a channel for each register I want to read and have them all set at 0.1s interval. Now, I also need to set some registers and I made a small sequence for that. the button ' zero displacement' invokes this sequence. the registers I want to set all have their own channel as well. This works but only sometimes... with reading every 0.1s I get lots of ' port locked' errors. I quess that i need to pauze the reading for a moment to make room on the bus for setting the appropriate registers. Could you give me a hint on how to solve these issues? Thanks, Koen for legacy reasons, I run this file in DAQfactory 5.87c DirksonWTB_22kN_v1.ctl Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted December 11, 2019 Share Posted December 11, 2019 Yes, at 0.1 seconds there may not be any space between the queries to allow for an output. One way to resolve this is, as you said, to pause the reading. You can do this by moving the timing of the reads into script. To do this, put all the input channels into their own channel group, say "Input", and set the Timing of them to 0. Then create a sequence. The script would simply be: while(1) channel.readGroup("Input") delay(0.1) endwhile When the sequence is running, it will query the inputs. When you stop it, it will stop querying the inputs. Use beginseq() and endseq() from script to do this. Quote Link to comment Share on other sites More sharing options...
kkoen Posted December 12, 2019 Author Share Posted December 12, 2019 Yes, that works! Only thing is that since the channels are in two different groups now, I can no longer open the channel to see the graph or table view. I can only open the list of channels with all their properties. This is only necesary for debugging, and maybe it has to do with the older DAQ version? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted December 17, 2019 Share Posted December 17, 2019 No, you should see something like: CHANNELS: + Group1 + Input + Main You can click on the plus next to the group and the individual channels in that group will appear. Then you can get to the channel view with the graph/table. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.