06-17-2009 04:32 AM
Hello all,
I know that the 1097 error is a very common one, and it has been reviewed in this forum many times, but i couldn't find the solution to my problem .. Even KnowledgeBase didn't help.
I've written a simple code just to open a session with the serial port :
receive.c :
-----------
#include <ansi_c.h>
#include <cvirte.h>
#include <userint.h>
#include <rs232.h>
#include <utility.h>
#include <formatio.h>
#include <string.h>
#include "stdio.h"
#include "stdlib.h"
#include "receive.h"
int RS232Error;
int receive()
{
RS232Error = OpenComConfig (1, "COM1", 9600, 0,
8, 1, 4500, 4500);
if (RS232Error == 0)
{
SetXMode(1, 0);
SetCTSMode(1, 0);
SetComTime(1, 5);
}
return RS232Error;
}
receive.h :
-----------
int receive();
I created the dll for that function, and the 1st time I run it , i get a 1097 error .. The 2nd time and on, i get a return of -7 (Cannot Open Port).
And if you're wondering why my portnumber is 1 and the device name is "COM1" although I'm using a PC, it's because when I use 0 as port number I get a return of -2 (Invalid Port Number).
Would anyone, Puh-leaaase, help ?
Thanks
Solved! Go to Solution.
06-17-2009 04:34 AM
06-17-2009 04:50 AM
No i haven't, coz it wouldn't be much of a help in my case.
06-17-2009 08:55 AM
More tests were done, and the thing is that everything is perfect when i generate a "Full Run-Time Engine" DLL and test it.
But when the DLL's Run-Time support is "Real-Time Only" , I'm getting these errors !
Medic !!! Please !!
06-23-2009 01:35 AM
Hi 0033.
Have you find any solution? Did you do more tests?
Regards.
Romain D.
National Instruments France
NIDays 2010 : Conférence mondiale de l'instrumentation virtuelle
>>Détails et Inscription<<
06-23-2009 03:32 AM
Hey R_Duval,
I'm out of tests .. Since that little code functions well on the PC, but doesn't function at all on a real-time machine !
I contacted National Instruments for that, and still no answer from their side !
06-25-2009 01:38 AM
HI
Do you have any feedback from NI?
Could you share the information?
Thanks.
Romain D.
National Instruments France
NIDays 2010 : Conférence mondiale de l'instrumentation virtuelle
>>Détails et Inscription<<
06-25-2009 07:15 AM
I just got a call from National Instrument's costumer serivce, and they told me that the library "RS232.h" isn't supported in Real Time mode !
Such an inconvenient !
Honestly, I'm not very convince, but they said they'll get back to me with a solution ..
I'll keep u guys updated
06-26-2009 04:33 AM - edited 06-26-2009 04:34 AM
Problem Resolved !
I had to install the RT Serial Module !
Cheers
06-26-2009 06:15 AM
Hi.
Very thanks for your feedback here. It should be helpfull for others.
Have a nice day and a great weekend.
Regards.
Romain D.
National Instruments France
NIDays 2010 : Conférence mondiale de l'instrumentation virtuelle
>>Détails et Inscription<<