C# Cluster Communication Help needed

Programs / Tools / Scripts
Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: C# Cluster Communication Help needed

Postby megajuz3003 » Tue Nov 14, 2017 4:00 pm

I think it should be defined as Byte() then sent F2, 57, 4, 0, B3

at least from the research I've been doing... can I ask what made you choose C# it looks like everyone on here uses VB

Site Admin
User avatar
Posts: 6562
Joined: Sat Feb 28, 2009 8:34 pm

Re: C# Cluster Communication Help needed

Postby antus » Tue Nov 14, 2017 4:04 pm

Yes, they are all the same on the wire. Your thinking like a human. Byte array is the most appropriate.

As for the receive, your dump looks like blocks of read data, not ALDL packets. Next step is to read the headers, sync up, and assemble that data stream in to packets. There is no start byte or stop byte, so its a bit tricky. Generally you do a read, let it fail, to identify silence then try and read the device and length from the next packet then wait for the rest of the frame to come in and then handle it appropriately.
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

User avatar
Posts: 58
Joined: Sun Jan 01, 2017 7:50 pm

Re: C# Cluster Communication Help needed

Postby commodorenut » Tue Nov 14, 2017 4:15 pm

antus wrote:Yes, they are all the same on the wire. Your thinking like a human. Byte array is the most appropriate.

As for the receive, your dump looks like blocks of read data, not ALDL packets. Next step is to read the headers, sync up, and assemble that data stream in to packets. There is no start byte or stop byte, so its a bit tricky. Generally you do a read, let it fail, to identify silence then try and read the device and length from the next packet then wait for the rest of the frame to come in and then handle it appropriately.



OMG antus after reading that i need to go take 10 panadol..lol

User avatar
Posts: 58
Joined: Sun Jan 01, 2017 7:50 pm

Re: C# Cluster Communication Help needed

Postby commodorenut » Tue Nov 14, 2017 4:19 pm

megajuz3003 wrote:I think it should be defined as Byte() then sent F2, 57, 4, 0, B3

at least from the research I've been doing... can I ask what made you choose C# it looks like everyone on here uses VB



Honestly i dont know why i chose c#

I was told you can do alot more with C# over VB ( i dont know how true that is thou ).

Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: C# Cluster Communication Help needed

Postby megajuz3003 » Tue Nov 14, 2017 4:26 pm

commodorenut wrote:
Honestly i dont know why i chose c#

I was told you can do alot more with C# over VB ( i dont know how true that is thou ).



fair enough :) I've only ever done basic apps is VB and C# (PHP and SQL is another story did that for work for 8 years), so that's why I was asking,

I'm still trying to "decode" the tables so I can actually pull the data and turn it into something usable :D

User avatar
Posts: 58
Joined: Sun Jan 01, 2017 7:50 pm

Re: C# Cluster Communication Help needed

Postby commodorenut » Tue Nov 14, 2017 4:35 pm

megajuz3003 wrote:
commodorenut wrote:
Honestly i dont know why i chose c#

I was told you can do alot more with C# over VB ( i dont know how true that is thou ).



fair enough :) I've only ever done basic apps is VB and C# (PHP and SQL is another story did that for work for 8 years), so that's why I was asking,

I'm still trying to "decode" the tables so I can actually pull the data and turn it into something usable :D



Im quite good with Coldfusion, But wow c# is totally different in everyway..

This is my second week with c#

Site Admin
User avatar
Posts: 6562
Joined: Sat Feb 28, 2009 8:34 pm

Re: C# Cluster Communication Help needed

Postby antus » Tue Nov 14, 2017 4:37 pm

Are you familiar with the ALDL format? Eg

F2 57 04 00 B3 is:

Device: F2
Length: 57 (57-52=5 Byte packet)
Mode: 04 (type of command)
Mode2: 00 (sorry dont know the correct name, really a paramater to the mode command)
Checksum: B3

So you Read 2 bytes to get as far as the length, Then you know total length is 5, so read 3 more bytes. Then calculate and check the checksum (discard if you calculate B3 but the last byte is not B3). Then check if your handling packets for device F2, and if so go to your handler for mode 4, and it can read 00 and do the appropriate thing.

Having said that, F2 is the dash so your sending it not receiving it, but the concept to read an ALDL packet is about right.

Sorry if this is not clear.

C# is a good language, but your going to need to understand ALDL to structure your app the right way. But if its your first app just jump right in and it'll become clear as you go. In my work as a software dev we have always said "write the first one to throw away" as an investigation exercise.

C# is an object orientated language, so its designed to be written a certain way. If you dont know OO it might be worth reading something general or something which explains that to get an idea of the app layout.
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

Posts: 74
Joined: Sun Aug 26, 2012 9:47 pm
Location: Brisbane

Re: C# Cluster Communication Help needed

Postby megajuz3003 » Tue Nov 14, 2017 4:46 pm

antus wrote:Mode2: 00 (sorry dont know the correct name, really a paramater to the mode command)


.. ive been calling that a Table :lol: probably not right either but it makes sense to me, im sifting through posts here, just commodore and google , as well as playing with spare parts on a bench harness and trying to collate it all into a single document but I'm starting to get a better understanding of how it all works

Site Admin
User avatar
Posts: 6562
Joined: Sat Feb 28, 2009 8:34 pm

Re: C# Cluster Communication Help needed

Postby antus » Tue Nov 14, 2017 4:58 pm

This would be the most detail thread around:
viewtopic.php?f=10&t=219
Have you read the FAQ? For lots of information and links to significant threads see here: viewtopic.php?f=7&t=1396

User avatar
Posts: 58
Joined: Sun Jan 01, 2017 7:50 pm

Re: C# Cluster Communication Help needed

Postby commodorenut » Tue Nov 14, 2017 5:12 pm

antus wrote:Are you familiar with the ALDL format? Eg

F2 57 04 00 B3 is:

Device: F2
Length: 57 (57-52=5 Byte packet)
Mode: 04 (type of command)
Mode2: 00 (sorry dont know the correct name, really a paramater to the mode command)
Checksum: B3

So you Read 2 bytes to get as far as the length, Then you know total length is 5, so read 3 more bytes. Then calculate and check the checksum (discard if you calculate B3 but the last byte is not B3). Then check if your handling packets for device F2, and if so go to your handler for mode 4, and it can read 00 and do the appropriate thing.

Having said that, F2 is the dash so your sending it not receiving it, but the concept to read an ALDL packet is about right.

Sorry if this is not clear.

C# is a good language, but your going to need to understand ALDL to structure your app the right way. But if its your first app just jump right in and it'll become clear as you go. In my work as a software dev we have always said "write the first one to throw away" as an investigation exercise.

C# is an object orientated language, so its designed to be written a certain way. If you dont know OO it might be worth reading something general or something which explains that to get an idea of the app layout.




Ok this string here which i read from the tech 2 will move the fuel guage to half...

F2, 83, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7F, 0, 0, 4, [ check sum ]

checked and works on the OSE tool

so with check sum should be 87

PreviousNext

Return to Tools

Who is online

Users browsing this forum: No registered users and 5 guests