05-09-2011 09:05 AM
Hi,
I am using TS 3.5 and i am calling a dll which has an input type of char. according to dll's datasheet i need to enter a character like 'n' . But TS doesn't accept it. I tried to enter 116 (Ascii code of 'n') but it didn't work either.
I am really confused while defining type of char type variables. I found out that TS assumes integer type variables as char but what about char variables.
Any help is appreciated generously 🙂
05-10-2011 09:34 AM
You will want to check out the following article:
How Can I Get the Character Representation of an ASCII Number in TestStand?
http://digital.ni.com/public.nsf/allkb/534E7A7C52D6223586256B9200543A83?OpenDocument
05-10-2011 09:36 AM
In C/C++ a variable of type char is just a 1-byte integer. It's a matter of interpretation of that integer whether or not it indicates a particular letter.
The ascii code for n is 110. Perhaps this is the problem you are having? Also there is a TestStand expression function you can use instead if you prefer as follows:
Asc("n")
Hope this helps,
-Doug
05-10-2011 09:38 AM
Unfortunately this is not what i am looking for. The dll prototype requests char type variables. So i cannot define it as a String (const *char) in TS, dll doesn't work with this method. Somehow i have to send 'n' character. I tried to send 116 which is the ascii number of n but even it didn't work
05-10-2011 09:41 AM
Note: My previous reply was for Online Courses not Doug also another update i didn't write 116 for 'n', i tried 110 as Doug adviced
05-10-2011 03:20 PM - edited 05-10-2011 03:22 PM
Both 110 and Asc("n") should work. What is the exact prototype of your C function and what do you have it specified as in the Dll/C++ adapter?
If you have a parameter like the following:
void myfunc(char mycharparam)
You should specify it as a Number, by value, signed 1-byte integer.
-Doug