Commit fd52a6be authored by Claes's avatar Claes

Arduino modifications

parent 1ed6ea18
......@@ -66,8 +66,9 @@ typedef struct {
#include <termios.h>
static FILE *fp;
// static FILE *fp;
#if 0
static void logg( const char *str)
{
pwr_tTime t;
......@@ -79,6 +80,7 @@ static void logg( const char *str)
fprintf( fp, "%s%04lld %s\n", timstr, t.tv_nsec/100000, str);
}
#endif
typedef enum {
ard_eMsgType_Write = 1,
......@@ -121,7 +123,7 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size)
msize = 0;
msize += read( fd, rmsg, 1);
logg( "Receive read");
// logg( "Receive read");
while ( msize < rmsg->size) {
sts = select(fd+1, &rfd, NULL, NULL, &tv);
......@@ -129,7 +131,7 @@ static int receive( int fd, int id, ard_sMsg *rmsg, int size)
msize += read( fd, (char *)rmsg + msize, rmsg->size - msize);
logg( "Receive read ++");
// logg( "Receive read ++");
}
......@@ -157,7 +159,7 @@ static int poll_di( ard_sMsg *msg, io_sLocal *local)
msg->id = local->IdCnt++;
msg->type = ard_eMsgType_DiRead;
logg( "Poll Di");
// logg( "Poll Di");
sts = write( local->fd, msg, msg->size);
local->DiPollId = msg->id;
local->DiPendingPoll = 1;
......@@ -178,7 +180,7 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
unsigned char wdg;
struct termios tty_attributes;
fp = fopen( "/home/claes/ard.log", "w"); // Test
// fp = fopen( "/home/claes/ard.log", "w"); // Test
local = (io_sLocal *) calloc( 1, sizeof(io_sLocal));
cp->Local = local;
......@@ -396,6 +398,8 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
else {
errh_Error( "IO Init Card '%s', config error: %d", cp->Name, sts);
op->Status = sts;
if ( sts == pwr_eArduino_StatusEnum_NoMessage)
sts = pwr_eArduino_StatusEnum_ConnectionTimeout;
return IO__INITFAIL;
printf( "Config read error %d\n", sts);
}
......@@ -415,7 +419,7 @@ static pwr_tStatus IoCardClose( io_tCtx ctx,
close( local->fd);
free( cp->Local);
fclose(fp); //Test
// fclose(fp); //Test
return IO__SUCCESS;
}
......@@ -447,7 +451,7 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
msg.id = local->IdCnt++;
msg.type = ard_eMsgType_DiRead;
logg( "Poll Di");
// logg( "Poll Di");
sts = write( local->fd, &msg, msg.size);
#endif
......@@ -574,7 +578,7 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
}
logg( "Write Do");
// logg( "Write Do");
sts = write( local->fd, &msg, msg.size);
}
......
Volume OtherIO $ClassVolume 0.0.250.10
Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X170"
Attr NextOix = "_X171"
Attr NextCix = "_X17"
Attr NextTix[0] = "_X8"
EndBody
......@@ -374,6 +374,13 @@ Volume OtherIO $ClassVolume 0.0.250.10
Attr Value = 20
EndBody
EndObject
Object ConnectionTimeout $Value 171 17-JAN-2011 18:13:00.46
Body SysBody 17-JAN-2011 18:13:05.37
Attr Text = "ConnectionTimeout"
Attr PgmName = "ConnectionTimeout"
Attr Value = 22
EndBody
EndObject
EndObject
Object Arduino_BaudRateEnum $TypeDef 6 03-JAN-2011 21:16:43.20
Body SysBody 03-JAN-2011 21:07:09.34
......@@ -2594,7 +2601,7 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndObject
!/**
! Baud rate of the USB connection.
! For fast scantimes the baud rate has to be increased.
! For fast scantimes the baud rate has to be increased.
!*/
Object BaudRate $Attribute 21 03-JAN-2011 21:18:39.87
Body SysBody 03-JAN-2011 21:19:00.44
......@@ -2604,7 +2611,7 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndObject
!/**
! Options.
! If OptimizedDiPoll is set the poll message for Di values are sent
! If OptimizedDiPoll is set the poll message for Di values are sent
! at the end of the execution of the prevoius scan, instead of at
! the start of the execution.
!*/
......
......@@ -67,12 +67,12 @@
# define SET_VERSION(a, b, c, d) ((pwr_tVersion)((a << 24) + (a << 16) + (a << 8) + a))
#endif
#define pwrv_cBuildTimeStr "27-AUG-2010 12:00:00"
#define pwrv_cBuildTimeStr "14-JAN-2011 20:00:00"
#define pwrv_cPwrVersionStr "V4.8.0"
#define pwrv_cPwrVersion SET_VERSION('V', 4, 8, 0)
#define pwrv_cPwrVersionStr "V4.8.1"
#define pwrv_cPwrVersion SET_VERSION('V', 4, 8, 1)
#define pwrv_cWbdbVersionShortStr "V48"
#define pwrv_cPwrCopyright "Copyright (C) 2005-2010 SSAB Oxelsund"
#define pwrv_cPwrCopyright "Copyright (C) 2005-2011 SSAB Oxelsund"
#endif
Package: pwr48
Version: 4.8.0-1
Version: 4.8.1-0.1
Section: base
Priority: optional
Architecture: i386
......@@ -9,3 +9,7 @@ Maintainer: Proview <postmaster@proview.se>
Description: Proview development and runtime environment package
Proview development and runtime environment
4.8.0-1 Base release
4.8.1-0.1 Beta release
- I/O support for Arduino USB board.
- Remote support for Websphere Message Queue.
- Operator event logging and replay.
Package: pwr48
Version: 4.8.0-1
Version: 4.8.1-0.2
Section: base
Priority: optional
Architecture: i386
......@@ -9,3 +9,7 @@ Maintainer: Proview <postmaster@proview.se>
Description: Proview development and runtime environment package
Proview development and runtime environment
4.8.0-1 Base release
4.8.1-0.1 Beta release
- I/O support for Arduino USB board.
- Remote support for Websphere Message Queue.
- Operator event logging and replay.
......@@ -319,6 +319,11 @@ palette NavigatorPalette
menu USB
{
class USB_Agent
menu Arduino
{
class Arduino_USB
class Arduino_Uno
}
menu Velleman_K8055
{
class Velleman_K8055
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment