Hello,
My name is Mike and for a current project i am working with rs485 RTU on Flowcode 8.
I need to get an analog input working on the slave, i tried setanaloginput and read analog input, but i cant see the changes on my master.
I know how to get the digital in and outputs working but it does not work the same with the analog... I wonder if anyone can look at my code and tell me what i am doing wrong and how to get it working
Thanks in advance.
485 analog input register
Moderator: Benj
-
- Posts: 4
- Joined: Sun Oct 18, 2020 7:21 pm
- Contact:
-
- Posts: 65
- Joined: Thu Feb 07, 2008 7:59 am
- Has thanked: 17 times
- Been thanked: 10 times
- Contact:
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: 485 analog input register
Hello Mike
When Modbus master sends a request to slave what is the value of byte 'raw_RX_antw_master'?
Can you insert in your code the decision:
-------------------------------------
If raw_RX_antw_master=255
--------------------------------------
Is it CRC issue?
Did you try to send to Modbus master only one analog value?
When Modbus master sends a request to slave what is the value of byte 'raw_RX_antw_master'?
Can you insert in your code the decision:
-------------------------------------
If raw_RX_antw_master=255
--------------------------------------
Is it CRC issue?
Did you try to send to Modbus master only one analog value?
-
- Posts: 4
- Joined: Sun Oct 18, 2020 7:21 pm
- Contact:
Re: 485 analog input register
hi, thanks for a reply.
I tried it but it is not a CRC fail, the slave will answer a default replay as it seems from the scope.
It doesn't matter what i set the answer will always be the same(see attachments), even if i remove everything and only initialise the slave.
I wonder if you can take a look at this and tell me what the problem is because i can't see it.
Kind regards,
I tried it but it is not a CRC fail, the slave will answer a default replay as it seems from the scope.
It doesn't matter what i set the answer will always be the same(see attachments), even if i remove everything and only initialise the slave.
I wonder if you can take a look at this and tell me what the problem is because i can't see it.
Kind regards,
- Attachments
-
- forum question analog input.fcfx
- (19.28 KiB) Downloaded 145 times
-
- anwser slave.png (28.11 KiB) Viewed 2478 times
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: 485 analog input register
Hello Mike
I changed a bit your Slave12 and run it with FC8 run Master (not on PIC, bur Arduino).
All works OK on Arduino.
Please check you PIC hardware connections and settings.
I created a quick guide.
https://www.matrixtsl.com/mmforums/view ... 60#p103660
I changed a bit your Slave12 and run it with FC8 run Master (not on PIC, bur Arduino).
All works OK on Arduino.
Please check you PIC hardware connections and settings.
I created a quick guide.
https://www.matrixtsl.com/mmforums/view ... 60#p103660