Sign in to follow this  
Followers 0
prakashteki

How to test my C code using AutoIt

12 posts in this topic

I am working in embedded domain. Without hardware, I want to test my logic writtedn in C language. How can I write the AutoIt script for this ? Please help if any body knows it.

Share this post


Link to post
Share on other sites



Thats pretty vague..but check out It might help you.

Share this post


Link to post
Share on other sites

Thanks Beege,

Its not fulfilling my hungryness.

I will give my requirement in some more detail:

1. My code has to display "CD loading" when CD got inserted.

2. Now my logic is ready for that

3. But, now there is no hardware to insert a CD

4. I will write some stub code to give a CD insert event to my logic which will display "CD Loading"

5. My requiremnt is that, am I able to write a GUI button such a way that whenever I click on that button, it has to call the stub function

which will send a CD insert event to my Logic.

6. How Can I achieve this above point 5.

Please help me.

Share this post


Link to post
Share on other sites

Hi, Prakashteki. From your requirements list you need to:

1. Build your GUI (See GuiCreate example in the help file)

2. Add a button (See _GUICtrlButton_Create in the help file)

3. Add code to have that button call your CD insert logic (try _GUICtrlButton_GetState in the help file)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Thanks JLogan3o13.

I will go through it.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hey, These functions GuiCreate, _GUICtrlButton_Create.... are for creating GUI. That is fine.

Now when I want to call my C language function definition. It is throughing error.

When I click that button, I am simply calling a function which is in another file (say abc.c).

May I need to compile with different compiler or need to change anything.

Please help me.

Edited by prakashteki

Share this post


Link to post
Share on other sites

Now when I want to call my C language function definition. It is throughing error.

When I click that button, I am simply calling a function which is in another file (say abc.c).

I'm hoping I'm reading this wrong. AutoIt can only execute code written with the AutoIt language. Your not actually trying to call a function written in c with AutoIt are you?

Also Its hard to help you find whats wrong with your script without actually seeing your script. Post your code and we will be able to help you much better :)

Share this post


Link to post
Share on other sites

Yes. You are correct. I am calling a function written in C language style (My whole project has been done in C only) not in AutoIt style.

I am finding out for the way by which I can do it. I hope I will get a solution.

Share this post


Link to post
Share on other sites

Prakashteki, can you please confirm that this is what you have?

1. A compiled C - language executable.

2. An AutoIt script that, when you choose the CD insert event, calls to that EXTERNAL C-language executable


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Sorry if its actual c source code that your trying to call thats just not going to work ( for pretty obvious reasons IMOP). The only possible solution that I have ever seen on these forums is the one I put in post 2.

Share this post


Link to post
Share on other sites

I agree, Beege. My original (probably mistaken) assumption was he was calling to some external app...


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Currently we are using Altia for creating the button inputs, and we connect this to Matlab simulink. It will interact with the Matlab Stateflow.

For this we need to to connect Altia for Matlab.

Is it possible to replace Altia by Autoit ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0