Recent Posts

Pages: 1 ... 8 9 [10]
91
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on March 26, 2018, 05:06:47 PM »
K I’ll set those variables up as floats and I’ll send 4 bytes worth of status bits, to make 5 floats total, 20 bytes. I probably will add fuel pressure, and possibly drive pressure in the future. Everything else I want to monitor I can get on my Scangauge.

So looking into the unique addressing for each variable, I think I can set up different ID/Masks and have individual send commands on the Master for each one. Then on the Slave side, have individual msgavailable commands looking for a data packet on the bus addressed to those ID’s, grab the data when available, and write it to where I want it.

On another front, I have the thermocouple amp talking to the Uno over SPI. I don’t have a thermocouple yet, so it’s just reading NAN. Next will be wiring the Pro Mini and it’s CAN board to get them talking, then establishing the CAN bus between them.
92
General Discussion / Re: Starting a new build
« Last post by Rx7man on March 25, 2018, 09:52:19 PM »
I'd send everything as a float and be done with it..

I'd bet as time goes on you're going to add a lot more stuff to display.. fuel pressure, oil pressure, turbo data feedback, etc

I'd just create a CAN address for each variable and send the data to it, the slave listens for many addresses and handles each one separately
93
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on March 25, 2018, 07:14:18 PM »
Yes this does help, I will probably use a union on the master side. The only reason I have a float is so that I can report Actual Vane Position in fractions of 0.50, possibly 0.25. The data I want to send is Turbo Shaft Speed (Long, because it can get above 100k), Vane Position (float), Boost Pressure (int), and EGT (int). I should probably send one or two bytes to use as status bits for displaying things like Turbo Inactive, Actual Operating Mode (Idle, Normal, Cruise, Braking), Manual Vane Control Active, etc. So that's 14 bytes total.
94
General Discussion / Re: Starting a new build
« Last post by Rx7man on March 25, 2018, 06:31:21 PM »
For your array problem, look up Unions.. they can represent any data type on its binary level and convert without any overhead

So a float is 4 bytes long, transferring the information by text would take 10 bytes for 10 digits (plus one for a decimal point).. I can't remember if my syntax is completely correct, but I'll give it a shot off the top of my head.. Only requirement is that all data types are the same length AFAIK

Code: [Select]

float f1 = 12.345f;
unsigned long int ul1 = 1392487ul;
signed long int      sl1 = -234453l;

union fourbyte{
float f;
long int l;
unsigned long int ul;
byte[4] b;
}

//to use it now
void loop{
fourbyte DataToSend;

DataToSend.f = f1;
SendToDevice(DataToSend);

DataToSend.ul = ul1;
SendToDeveice(DataToSend);

DataToSend.sl = sl1;
SendToDevice(DataToSend);
}

void SendToDevice(fourbyte data){
  for(int i = 0; i<4; i++){
    SomehowSendByte(data.b[i]);
  }
}

I just transfer EVERYTHING as a float so I don't need to keep track of what kind of data type I'm dealing with

At the other end, take your four received data bytes as an array, assign them to the byte subtype of the "fourbyte" and then use the "float" subtype to get the value


Hope that is what you were looking for
95
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on March 25, 2018, 06:03:04 PM »
Making some progress...

I ended up ordering another LCD with an I2C interface board already soldered on. 4 wires to the Pro Mini (VCC, GND, SDA, SCL) and it’s talking. I’m using the NewLiquidCrystal lib for commands and it seems to be refreshing very smoothly. I programmed some incrementing counters for formatting and testing the display. I’ll just write data that comes in over SPI from the Uno to those variables.

I believe I have the SPI interface between the Uno and Pro Mini wired, and I’m working on the coding. Maybe you guys can help - I want to build an array from a long, float, and 2 ints. My idea was to arrange the data into an array of bytes, serialize and transfer the array over SPI, then put the bytes back into the variable types on the other side. Then I’ll print them to the LCD with every refresh. I’m sure I’ll have to play with transfer and delay timers to make it all function smoothly.
96
General Discussion / Re: Starting a new build
« Last post by Rx7man on March 23, 2018, 01:22:23 PM »
I'm not very fond of the MAX31855.. never was able to get them working right,.. maybe the chinese board they were on were bad beyond what I saw and fixed on them .... In theory they should be simpler, no initialization requirements is kinda
97
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on March 23, 2018, 10:26:42 AM »
Yep!!! I see that day in and day out. I'm part of a group of 11 software/controls engineers, and there are a few other groups throughout the plant with the same responsibilities/access we do. So if we or they change a program, they take it over. Makes revision control a nightmare, especially for HMI's.

Anyway, I ordered a few breadboards, a bundle of jumpers, a kit of misc headers, and a TXB0104 board for the MAX31855 thermocouple amp. I've read that the MAX31855 will work with 5V, but won't last long. The TXB0104 will drop the voltage to 3.3V to get a lot more life out of it. I also ordered the 351VE connector parts from Mouser, thank you for the project list link!
98
General Discussion / Re: Starting a new build
« Last post by hakcenter on March 23, 2018, 10:22:51 AM »
LOL Linx, what a nightmare. Never ever ever update, LOL

And keep every version of every install different, and you're pretty much good to go.

I did a lot of automation for bottling companies with a good friend of mine. Ladder logic is so simple though.

There was times, hey you know if we fix this program.. you know we own the machine at this point right? :)
99
General Discussion / Re: Starting a new build
« Last post by Rx7man on March 22, 2018, 09:44:01 PM »
Might be interested in this... my buddy who still works at that company and is doing some moonlight work seems to like them.. Velocio.net
100
General Discussion / Re: Starting a new build
« Last post by Chewy1576 on March 22, 2018, 08:43:07 PM »
I work mostly in function block with Siemens, but you can do ladder too. We have some machines with AB hardware so I’ve seen a little bit, but I do agree with you about RS Linx and the multiple versions of RS Logix. I’ve looked at Soapbox to use ladder with an Arduino, but I don’t know if all of the functions for actuator communication and control needed would be available.
Pages: 1 ... 8 9 [10]