{"action":"created","issue":{"url":"https://api.github.com/repos/stephane/libmodbus/issues/262","labels_url":"https://api.github.com/repos/stephane/libmodbus/issues/262/labels{/name}","comments_url":"https://api.github.com/repos/stephane/libmodbus/issues/262/comments","events_url":"https://api.github.com/repos/stephane/libmodbus/issues/262/events","html_url":"https://github.com/stephane/libmodbus/issues/262","id":74103580,"number":262,"title":"modbus_read_registers - change *dest to signed integer","user":{"login":"davisjp1822","id":5446871,"avatar_url":"https://avatars.githubusercontent.com/u/5446871?v=3","gravatar_id":"","url":"https://api.github.com/users/davisjp1822","html_url":"https://github.com/davisjp1822","followers_url":"https://api.github.com/users/davisjp1822/followers","following_url":"https://api.github.com/users/davisjp1822/following{/other_user}","gists_url":"https://api.github.com/users/davisjp1822/gists{/gist_id}","starred_url":"https://api.github.com/users/davisjp1822/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisjp1822/subscriptions","organizations_url":"https://api.github.com/users/davisjp1822/orgs","repos_url":"https://api.github.com/users/davisjp1822/repos","events_url":"https://api.github.com/users/davisjp1822/events{/privacy}","received_events_url":"https://api.github.com/users/davisjp1822/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-07T19:41:52Z","updated_at":"2015-05-07T21:05:43Z","closed_at":null,"body":"Hello - thank you for the fantastic library!\r\n\r\nI am using libmodbus to control an AMCI SMD23E integrated stepper/motor drive over Modbus/TCP:\r\n\r\nhttp://amci.com/stepper-motor-control/integrated-stepper-motor-control-smd23e.asp\r\n\r\nThe SMD reports motor position and encoder position via the Input Words. These values are reported in 16 bit words (decimal) that can be negative. Currently, *dest in modbus_read_registers is a uint16_t - not allowing me to read negative values. Could you change this to int16_t please?\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/stephane/libmodbus/issues/comments/100018999","html_url":"https://github.com/stephane/libmodbus/issues/262#issuecomment-100018999","issue_url":"https://api.github.com/repos/stephane/libmodbus/issues/262","id":100018999,"user":{"login":"mhei","id":1313451,"avatar_url":"https://avatars.githubusercontent.com/u/1313451?v=3","gravatar_id":"","url":"https://api.github.com/users/mhei","html_url":"https://github.com/mhei","followers_url":"https://api.github.com/users/mhei/followers","following_url":"https://api.github.com/users/mhei/following{/other_user}","gists_url":"https://api.github.com/users/mhei/gists{/gist_id}","starred_url":"https://api.github.com/users/mhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhei/subscriptions","organizations_url":"https://api.github.com/users/mhei/orgs","repos_url":"https://api.github.com/users/mhei/repos","events_url":"https://api.github.com/users/mhei/events{/privacy}","received_events_url":"https://api.github.com/users/mhei/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T21:05:43Z","updated_at":"2015-05-07T21:05:43Z","body":"Isn't a simple type cast a solution - or do I miss anything?\r\n\r\n```c\r\nint16_t position;\r\n...\r\n\r\nrc = modbus_read_registers(ctx, 0, 1, (uint16_t *)&position);\r\n```"}}