From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-18-2022 07:27 PM
I have a holding register as a 'new data flag'. The Modbus master reads this register every second to check if there is new data (Flag = 1), if so, it reads more (predefined) registers for the actual data. Once the data has been read, the Slave is supposed to reset the new data flag back to 0. However, I couldn't find an event handler in the Modbus API to enable such functionality. Anyone has ever run into a similar problem?
Solved! Go to Solution.
01-18-2022 09:36 PM
You need to add one address in slave for acknowledgment of reading from master. Let us assume that you read 'new data flag' from address 0x100h. You can add additional address (0x101h) in slave for acknowledgment. Once the master reads the data from 'new data flag' from 0x100h, it should also write 1 in the acknowledgment register 0x101h. the salve just need to check the acknowledgment register 0x101h. Once it is 1 then it should consider that the master has read the data and then the slave should overwrite the data with 0 in 0x101h.
01-19-2022 01:14 AM
Thank you for the suggestion. Unfortunately I can't dictate the Master's behavior. The Slave on this GC is able to detect the read action automatically, I am trying to implement something similar
https://www.agilent.com/cs/library/usermanuals/public/490-PRO%20Micro%20GC%20User%20Manual.pdf
01-19-2022 01:57 AM
Modbus is a rather old protocol designed to communicate with industrial devices (in origin, PLCs). It only features reads and writes.
Many companies tried to leverage this standard to implement new functionalities. For example in some cases you write into a register to trigger an action in the device. These are all nonstandard extensions that must be actively implemented in the slave loop. So, if your slave Modbus is open source you can add this new feature yourself, otherwise you have no chance.
01-19-2022 07:29 PM
Understood, thank you. I am using LabVIEW Modbus library. Will try to find a more flexible solution.
01-20-2022 01:58 AM - edited 01-20-2022 01:59 AM
There are multiple LabVIEW Modbus libraries. At least one of them is open source, see here. I used it in some projects but not heavily.
This library is an example, not a product, so it's unsupported. I had to correct a bug myself when I used it the first time, about 15 years ago.
01-20-2022 02:04 AM
Thank you for the additional info. Yes I was aware there are multiple libraries. What I meant was I am using the one that comes with LabVIEW installation (Part of DSC module I think). Sorry for the confusion.