| View previous topic :: View next topic |
| Author |
Message |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Fri Jun 10, 2011 1:08 am Post subject: [ASK]How to create simple wave on console |
|
|
i'm sorry, i am really a newbie here.
maybe my case like this: http://www.innovative-dsp.com/forum/viewtopic.php?t=1115
but i couldn't find any help.
I've tried the example: http://www.iidsp.com/forum/viewtopic.php?t=543
and it works, my led is turned on and off, but now i'm trying to create a simple wave output from my X5_400M, i've tried the wave example in C:\Innovative\X5-400MDevKit\Examples\Wave\Vc9\
it works, but i don't know how to create wave from that code,,
i hope someone could help me here.
thanks for your help |
|
| Back to top |
|
 |
phua
Joined: 04 May 2011 Posts: 31 Location: USA
|
Posted: Fri Jun 10, 2011 7:45 am Post subject: |
|
|
| Are you having problem compiling? What development enviornment are you using? Please provide more detail. |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Sun Jun 12, 2011 6:25 pm Post subject: |
|
|
No, i don't have any compiling problem, i just dont know how to generate a signal on console.
I'm using windows 7, Visual Studio 9 and C++,, here is my code
| Code: | #include <iostream>
#include "Malibu_Mb.h"
#include "X5_400M_Mb.h"
#include "StringSupport_Mb.h"
#include "SignalGen_Mb.h"
#include "PacketStream_Mb.h"
#include "StaticWaveform_App.h"
#include <ThunkerIntf_Mb.h>
#include "SystemSupport_Mb.h"
using namespace std;
using namespace Innovative;
namespace Innovative
{
class Thunker : public ThunkerIntf
{
friend class Dispatcher;
public:
//Ctor
Thunker(){};
virtual ~Thunker(){};
//Methods
virtual bool Notify(){return true;};
virtual void Dispatch(){};
private:
//Dispatcher Messenger;
};
//---------------
// NewThunker()--
//---------------
ThunkerIntf * NewThunker2()
{
return new Thunker;
}
//-------------------
// DeleteThunker() --
//-------------------
void DeleteThunker2(ThunkerIntf * thunker)
{
delete thunker;
}
std::auto_ptr<CommandLineArguments> GetCommandLineArguments()
{
return std::auto_ptr<CommandLineArguments>(0);
}
}
int main ()
{
cout << "hallooo\n";
cout << "hello \n" << endl;
//enum { stTone, stTriangle, stSquare, stDc };
X5_400M module;
PacketStream m_PacketStream;
StaticWaveform m_StaticWaveform;
int count = module.BoardCount();
if (count > 0)
{
module.Target(0);
module.Open();
module.Led(false);
Sleep(2000);
module.Led(true);
m_StaticWaveform.Frequency(50);
m_StaticWaveform.Amplitude(95);
m_PacketStream.Start();
Sleep(5000);
m_PacketStream.Stop();
module.Close();
}
else
{
cout << "No X5-400M modules detected" << endl;
}
return 0;
} |
i hope with this code, i could generate a wave with f=50 Hz and A=95%FS (is it true?) but i think i even don't have the source signal to be sampled,, and this code give me an error:
| Quote: | An unhandled exception of type 'System.AccessViolationException' occurred in Try.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. |
could anyone help me?
thx |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Tue Jun 14, 2011 2:53 am Post subject: |
|
|
I think I made a lot of mistakes from above code, now I'm trying to build a wave from wave.cpp on example and I change a little bit code at ApplicationIo.cpp
here is my code
I hope anyone would help me out |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Tue Jun 14, 2011 3:20 am Post subject: |
|
|
| From the code I posted above, I have no problem on compiling, but the waveform didn't come up on my oscilloscope, it should've displayed like the example with UI. |
|
| Back to top |
|
 |
phua
Joined: 04 May 2011 Posts: 31 Location: USA
|
Posted: Tue Jun 14, 2011 7:13 am Post subject: |
|
|
Lutfi,
We currently do not have a console version of Wave for Window 7. However, we do have it under other OSes. Feel free to model your code after it. Let me know if you have any problem.
You may download the package from:
http://www.innovative-dsp.com/ftp/X5-400M/Lufti |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Wed Jun 15, 2011 7:12 pm Post subject: |
|
|
Thank You for your reply phua
But when I tried to compile it, it shows errors:
| Quote: | 1>------ Build started: Project: Console, Configuration: Debug Win32 ------
1>Compiling...
1>ConsoleInterface.cpp
1>.\ConsoleInterface.cpp(147) : error C3861: 'HasFiclSupport': identifier not found
1>.\ConsoleInterface.cpp(151) : error C2039: 'ModIo' : is not a member of 'ApplicationIo'
1> C:\Innovative\X5-400MDevKit\Examples\Testing\Common\ApplicationIo.h(115) : see declaration of 'ApplicationIo'
1>.\ConsoleInterface.cpp(151) : error C2228: left of '.FiclConnectTo' must have class/struct/union
1>.\ConsoleInterface.cpp(151) : error C2039: 'FiclSys' : is not a member of 'ApplicationIo'
1> C:\Innovative\X5-400MDevKit\Examples\Testing\Common\ApplicationIo.h(115) : see declaration of 'ApplicationIo'
1>.\ConsoleInterface.cpp(153) : error C2039: 'FiclIo_Init' : is not a member of 'ApplicationIo'
1> C:\Innovative\X5-400MDevKit\Examples\Testing\Common\ApplicationIo.h(115) : see declaration of 'ApplicationIo'
1>ConsoleUserInterface.cpp
1>.\ConsoleUserInterface.cpp(33) : error C3861: 'assert': identifier not found
1>main.cpp
1>.\main.cpp(2) : fatal error C1083: Cannot open include file: 'CommandLine_Con.h': No such file or directory
1>Generating Code...
1>Build log was saved at "file://c:\Innovative\X5-400MDevKit\Examples\Testing\Console\Console\Debug\BuildLog.htm"
1>Console - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
I think the problem is on windows it needs addition modul called like Ficl. But when I tried to search it on google, i didn't find anything. And also I couldn't find file 'CommandLine_Con.h'.
Could you help me out?
Thanks before
[/code] |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Wed Jun 15, 2011 7:25 pm Post subject: |
|
|
By the way, when I saw your makefile code, I found on your INCPATH, it shows:
| Quote: | | ../../../../Malibu-1.5/Malibu -I../../../../Malibu-1.5/Malibu/Framework/Console -I |
There is no Malibu-1.5 in my Innovative folder, is it possible that we use the different version of malibu?
My CD's Installation comes from my board X5_400m 80180-2 with serial number E150
thank you |
|
| Back to top |
|
 |
jhenderson Site Admin
Joined: 07 Mar 2006 Posts: 2252 Location: So. Cal. USA
|
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Tue Jun 21, 2011 7:04 pm Post subject: |
|
|
I've tried the code and I did some changes, but it give error code like this:
| Quote: | 1>------ Build started: Project: Try, Configuration: Debug Win32 ------
1>Linking...
1>Try.obj : error LNK2028: unresolved token (0A000850) "public: __thiscall FPGAInterface::FPGAInterface(struct SystemParameters *)" (??0FPGAInterface@@$$FQAE@PAUSystemParameters@@@Z) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)
1>Try.obj : error LNK2028: unresolved token (0A000851) "public: virtual __thiscall FPGAInterface::~FPGAInterface(void)" (??1FPGAInterface@@$$FUAE@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)
1>Try.obj : error LNK2028: unresolved token (0A000852) "public: bool __thiscall FPGAInterface::StartFPGA(void)" (?StartFPGA@FPGAInterface@@$$FQAE_NXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)
1>Try.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall FPGAInterface::~FPGAInterface(void)" (??1FPGAInterface@@$$FUAE@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)
1>Try.obj : error LNK2019: unresolved external symbol "public: bool __thiscall FPGAInterface::StartFPGA(void)" (?StartFPGA@FPGAInterface@@$$FQAE_NXZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)
1>Try.obj : error LNK2019: unresolved external symbol "public: __thiscall FPGAInterface::FPGAInterface(struct SystemParameters *)" (??0FPGAInterface@@$$FQAE@PAUSystemParameters@@@Z) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z)
1>C:\Innovative\X5-400M\Examples\Testinglama\Try\Debug\Try.exe : fatal error LNK1120: 6 unresolved externals
1>Build log was saved at "file://c:\Innovative\X5-400M\Examples\Testinglama\Try\Try\Debug\BuildLog.htm"
1>Try - 7 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
now I dont know what to do anymore, here is my Code |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Tue Jun 21, 2011 7:26 pm Post subject: |
|
|
| here is my code in vc9 |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Wed Jun 22, 2011 1:13 am Post subject: |
|
|
just ignore what I've posted above.. hehe
| phua wrote: | Lutfi,
We currently do not have a console version of Wave for Window 7. However, we do have it under other OSes. Feel free to model your code after it. Let me know if you have any problem.
You may download the package from:
http://www.innovative-dsp.com/ftp/X5-400M/Lufti |
I've tried to adjust this code for windows 7, and it could be built, but when I run it, it only give me this message on console:
and BinView give me this result:
but when I connected the board X5_400M to oscilloscope, there is no activity on it.. Could you help me out?
thank you  |
|
| Back to top |
|
 |
jhenderson Site Admin
Joined: 07 Mar 2006 Posts: 2252 Location: So. Cal. USA
|
Posted: Wed Jun 22, 2011 4:36 am Post subject: |
|
|
Please post your settings.ini file, so that we can understand your IO configuration.
Since the elapsed time is reported as 0.000 seconds, it seems that you did not implement a dwell loop within the mainline which is required to allow the program to stream data for a while. If the mainline starts data flow, but immediately thereafter stops flow and closes, no waveform will be generated.
Binview is only relevant to viewing acquired data on disk, not generated analog data. How was the BV data file generated? |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Wed Jun 22, 2011 6:50 pm Post subject: |
|
|
here is my settings.ini, and as phua requested, I give my project code here.
I think there is 2 issues now, first is about how BV data file generated, actually I'm not really sure about it, because I just use phua's code, it's called in ModuleIo.cpp but with no action on it,, and the second issue that I think the most important thing is why my oscilloscope displays nothing but just noise? I've tried to give while(1) at main code, but it doesn't helping at all the ellapsed time still 0.
What's wrong with my code? |
|
| Back to top |
|
 |
lutfi
Joined: 06 Jun 2011 Posts: 31 Location: Indonesia
|
Posted: Wed Jun 22, 2011 11:35 pm Post subject: |
|
|
| jhenderson wrote: | Please post your settings.ini file, so that we can understand your IO configuration.
Since the elapsed time is reported as 0.000 seconds, it seems that you did not implement a dwell loop within the mainline which is required to allow the program to stream data for a while. If the mainline starts data flow, but immediately thereafter stops flow and closes, no waveform will be generated.
Binview is only relevant to viewing acquired data on disk, not generated analog data. How was the BV data file generated? |
about elapsed time, I think the problem is I couldn't find where the Clock.Start is executed, what I found is only elapsed=Clock.Stop at ApplicationIo.cpp so the Elapsed time become 0.000 seconds.
So, I tried to create my own function to start the clock on ConsoleInterface.cpp after StartStreaming being executed (line 110) and it shows this result:
but there was no changes on the waveform, still displaying some noise.
Could you help me? |
|
| Back to top |
|
 |
|