Sign in to follow this  
Followers 0
Leo

simultaneously read and write to a slave Twido

2 posts in this topic

Sorry for my english I'm using the Modbus protocol to communicate two twidos TWDLCA24DRF one as master and one as slave. I'm having difficulty writing and reading while the slave. Below is the code I tried to run, I am able to write to the slave but I am not able to read from slave. This is very important for my studies. Please Help me. (* WRITE TO SLAVE *) LD 1 [ %MW0 := 16#010C ] [ %MW1 := 16#0007 ] [ %MW2 := 16#0110 ] [ %MW3 := 16#0010 ] [ %MW4 := 16#0002 ] [ %MW5 := 16#0004 ] [ %MW6 := 16#FFFF ] [ %MW7 := 16#ABCD ] LD 1 AND %MSG2.D [ EXCH2 %MW0:11 ] LD %MSG2.E ST %Q0.0 (* READ TO SLAVE *) LD 1 [ %MW12 := 16#0106 ] [ %MW13 := 16#0300 ] [ %MW14 := 16#0103 ] [ %MW15 := 16#000C ] [ %MW16 := 16#0004 ] LD 1 AND %MSG2.D [ EXCH2 %MW12:23 ] LD %MSG2.E [ EXCH2 %SW64:13 ] ST %Q0.1 END Please HELP ME.

Share this post


Link to post
Share on other sites
do something simpler alternative measures of reading and writing with the system bit %S6 and see if it works in order to understand if the communication parameters are ok, after passing to increase the speed of queries

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0