phil's blog

Taglist Array Growth

When I originally wrote the tagname handling code I put all of the tags in a dynamically allocated array that I intended to grow as needed with calls to realloc(). I also have similar intentions with the database itself. The original size of these arrays as well as the amount that they grow are based on #define'd in dax/tagbase.h.

Install Woes

I've never really spent any time making sure that the OpenDAX package would install correctly. I am not very familiar with autoconf, automake, libtool etc. so all of that is a learning curve for me. I piddled with it enough today that I think it may actually work. One of the hardest parts seemed to be getting the $sysconfdir variable into a preprocessor define so that I could open the configuration files from the correct directory. I think that the solution that I have is kindof a kludge. I basically put a -DETC_DIR in the command line by assigning it to CFLAGS. I'd rather have it in config.h but I can't figure out how to do that.

DAX Command Line Client

I've started work on a module that will be a command line utility into DAX. Right now it does nothing, but the autoconf skeleton is there. It has brought up an interesting problem though. It introduced a library (libreadline) that I don't want to have to depend on. It won't use a lot of the really fancy features of readline but I figured if it was there we should use it. I don't want to depend on it however. I'd rather replace the code with gets() type calls instead of failing to build but I don't know how to do that.

A little more progress

I managed to get the Modbus module actually working and talking to the serial devices that I have as well as to a Lantronix device server. I had apparently broken the TCP socket stuff during a rewrite of the Modbus code before OpenDAX even existed. This also caused some bugs in the tagbase handling logic to show up and I dealt with those. There is probably still some uglyness lurking in there that I need to test for and eliminate.

This code is still very immature and I've begun to notice that there are some spots that might cause eternal system call blocks or undetected failures. I put my little /* TODO: comments in some of those places but I really should clean it all up before it gets out of hand.

Compiled vs. Interpreted Logic

I've just about got my first I/O module working. I've ported a Modbus program that I wrote many moons ago to work with OpenDAX. It's not any more complete than the DAX core is at this point but my goal at the moment is to get some specific Modbus devices working and that's really all the code that I have been working on.

A little bit of progress

I managed to write a couple of functions that use messaging to send the tags back and forth to the core. They are generic BYTE level routines that simply write the data. I still need to add some error checking to them. I'm gonna use these functions to get my Modbus module to work with all of this. Then I think that I'll start a logic module of some kind.

A little bit stuck

I seem to have a little bit of a mental block when it comes to writing the code to read and write from the database. I have started writing routines that use the message queue to read and write the tag values through the library from the modules. I am hesitant to write too much of the code because I'm afraid that I'll wind up redoing it all later. I think that in terms of reading and writing the data the message queue is the right idea over using shared memory. Shared memory is likely to be more efficient. Although to use shared memory I'll have to use semaphores to avoid the concurency issues, and this may make it no more efficient than the message queue.

Code Progress

Syndicate content