{"action":"created","issue":{"url":"https://api.github.com/repos/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/6","repository_url":"https://api.github.com/repos/iiitd-ucla-pc3/EM6400-Data-Uploader","labels_url":"https://api.github.com/repos/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/6/comments","events_url":"https://api.github.com/repos/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/6/events","html_url":"https://github.com/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/6","id":140919727,"number":6,"title":"Issue with serial read in python modbus with EM6400","user":{"login":"manasdas17","id":1115602,"avatar_url":"https://avatars.githubusercontent.com/u/1115602?v=3","gravatar_id":"","url":"https://api.github.com/users/manasdas17","html_url":"https://github.com/manasdas17","followers_url":"https://api.github.com/users/manasdas17/followers","following_url":"https://api.github.com/users/manasdas17/following{/other_user}","gists_url":"https://api.github.com/users/manasdas17/gists{/gist_id}","starred_url":"https://api.github.com/users/manasdas17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manasdas17/subscriptions","organizations_url":"https://api.github.com/users/manasdas17/orgs","repos_url":"https://api.github.com/users/manasdas17/repos","events_url":"https://api.github.com/users/manasdas17/events{/privacy}","received_events_url":"https://api.github.com/users/manasdas17/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-15T09:28:53Z","updated_at":"2016-03-15T11:18:48Z","closed_at":null,"body":"Hi,\r\n     I am trying to implement python modbus with EM6400 . The aim is to read the volatage,current etc value on python console.But i am able to read the data properly from EM6400.Please have a look at the code.\r\n\r\n```\r\nimport os\r\nimport sys\r\ncwd=os.getcwd()\r\n(setpath,Examples)=os.path.split(cwd)\r\nprint setpath\r\nsys.path.append(setpath)\r\n\r\nfrom PyArduino import *\r\n\r\nimport struct\r\n\r\n\r\nport=locateport()\r\nser = serial.Serial(port, 9600)\r\n\r\nser.write(\"\\x01\\x03\\x15\\x86\\x00\\x02\\x39\\x15\")\r\nbuf=ser.read(11)\r\n\r\nb1=b2=b3=b4=0\r\n\r\na1=buf[3]\r\n\t\t\t\r\nif (a1<16):\r\n    b1=1\r\n    a1=int(a1,16)\r\nif (b1):\r\n    a1='0'+str(a1)\r\n\r\n\r\na2=buf[4]\r\nif (a2<16):\r\n    b2=1\r\n    a2=int(a2,16)\r\nif (b2):\r\n    a2='0'+str(a2)\r\n\r\n\r\n\r\na3=buf[5]\r\nif (a3<16):\r\n    b3=1\r\n    a3=int(a3,16)\r\nif (b3):\r\n    a3='0'+str(a3)\r\n\r\na4=buf[6]\r\nif (a4<16):\r\n    b4=1\r\n    a4=int(a4,16)\r\nif (b4):\r\n    a4='0'+str(a4)\r\n\r\n\r\na5=[a3,a4,a1,a2];\r\na6=''.join(a5)\r\n\t\t\t\r\n\r\nprint struct.unpack('!f', a6.decode('hex'))[0]\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/comments/196769580","html_url":"https://github.com/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/6#issuecomment-196769580","issue_url":"https://api.github.com/repos/iiitd-ucla-pc3/EM6400-Data-Uploader/issues/6","id":196769580,"user":{"login":"nipunbatra","id":60985,"avatar_url":"https://avatars.githubusercontent.com/u/60985?v=3","gravatar_id":"","url":"https://api.github.com/users/nipunbatra","html_url":"https://github.com/nipunbatra","followers_url":"https://api.github.com/users/nipunbatra/followers","following_url":"https://api.github.com/users/nipunbatra/following{/other_user}","gists_url":"https://api.github.com/users/nipunbatra/gists{/gist_id}","starred_url":"https://api.github.com/users/nipunbatra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipunbatra/subscriptions","organizations_url":"https://api.github.com/users/nipunbatra/orgs","repos_url":"https://api.github.com/users/nipunbatra/repos","events_url":"https://api.github.com/users/nipunbatra/events{/privacy}","received_events_url":"https://api.github.com/users/nipunbatra/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T11:18:48Z","updated_at":"2016-03-15T11:18:48Z","body":"I'm afraid I won't be able to look into this any time soon. I used Pymodbus/MinimalModbus to handle the modbus communication properly. pyserial might have sufficed, but I let the modbus libraries handle the communication part."}}