ASCII support in libmodbus
Hiii
I am using the libmodbus, I have to communicate with a modbus client simulator which is in serial ascii. Is there any option in libmodbus for communicating with serial ascii devices ,Or could you please tell me some sample code for this communication.
Any responses are really appreciated
Thanks in Advance
Ajith James
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- libmodbus Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Ajith James
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
This question was expired because it remained in the 'Open' state without activity for the last 15 days.
Revision history for this message
|
#2 |
No ASCII support, it's really odd to require that format.
Revision history for this message
|
#3 |
Thanks steffanie, Stéphane Raimbault
by writing a wrapper i made it supported to ascii also
Revision history for this message
|
#4 |
> Thanks steffanie, Stéphane Raimbault
> by writing a wrapper i made it supported to ascii also
>
Could you provide a patch with that ASCII support, please?
Thank you.
Revision history for this message
|
#5 |
Sure,
I have modified your program bye adding a new type called ascii
then write a function to convert the libmodbus ascii to rtu form.
I am not sure this is a good way,I just do this trick :)
Thanks a lot,
Ajith
On Sun, Aug 2, 2009 at 4:36 AM, Stéphane Raimbault <
<email address hidden>> wrote:
> Your question #74711 on libmodbus changed:
> https:/
>
> Stéphane Raimbault posted a new comment:
> > Thanks steffanie, Stéphane Raimbault
> > by writing a wrapper i made it supported to ascii also
> >
>
> Could you provide a patch with that ASCII support, please?
> Thank you.
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>
Revision history for this message
|
#6 |
@Ajith James
Can you show your wrapper for modbus ascii ?
Thank in advance
Revision history for this message
|
#7 |
/* Builds a ASCII query from RTU */
static int build_query_
int query_length)
{
int i,j;
for(
{
switch(
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 10:
break;
case 11:
break;
case 12:
break;
case 13:
break;
case 14:
break;
case 15:
break;
}
i--;
switch(
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 10:
break;
case 11:
break;
case 12:
break;
case 13:
break;
case 14:
break;
case 15:
break;
}
// query[i] = 30 +((query[j]%16));
// query[i-1] = 30 +((query[j]/16));
i--;
j--;
}
query_ascii[0] = 0x3A;
query_
query_
return ((2*query_
}
/* extract RTU query from ASCII */
static int ext_query_
{
int i=0;
int j= 1;
while(
{
{
case 0x30:
break;
case 0x31:
break;
case 0x32:
break;
case 0x33:
break;
case 0x34:
break;
case 0x35:
break;
case 0x36:
break;
case 0x37:
break;
case 0x38:
break;
case 0x39:
break;
case 0x41:
break;
case 0x42:
break;
case 0x43:
break;
case 0x44:
break;
case 0x45:
break;
case 0x46:
break;
case 0x0D:
}
{
case 0x30:
break;
case 0x31:
break;
case 0x32:
break;
case 0x33:
break;
case 0x34:
break;
case 0x35:
break;
case 0x36:
break;
case 0x37:
break;
case 0x38:
break;
case 0x39:
break;
case 0x41:
break;
case 0x42:
break;
case 0x43:
break;
case 0x44:
break;
case 0x45:
break;
case 0x46:
break;
case 0x0D:
}
j+= 2;
i++;
}
return i;
}
void modbus_
{
}
else if ( mb_param->type_com == ASCII )
{
for (i = 0; i < query_length; i++)
s_lrc = lrc(query, query_length);
query,query_
}
On Tue, Aug 4, 2009 at 12:20 AM, Karol C. <
<email address hidden>> wrote:
> Your question #74711 on libmodbus changed:
> https:/
>
> Karol C. posted a new comment:
> @Ajith James
> Can you show your wrapper for modbus ascii ?
> Thank in advance
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>
Revision history for this message
|
#11 |
Hi ignatius,
The opportunity sounds interesting to me, i want to review more in detail
the job description.
Could you share with me the link?, i can't get it into the answers page.
Cheers,
alimon
On Mon, Oct 3, 2016 at 11:08 AM, ignatius <
<email address hidden>> wrote:
> Question #74711 on libmodbus changed:
> https:/
>
> ignatius posted a new comment:
> Hi!
>
> We are looking for employees working remotely.
>
> My name is Forrest, I am the personnel manager of a large International
> company.
> Most of the work you can do from home, that is, at a distance.
>
> Salary is $2800-$5500.
>
> If you are interested in this offer, please visit
> Our Site
>
> Best regards!
>
> --
> You received this question notification because your team Modbus Team is
> an answer contact for libmodbus.
>