15,906,816 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by mraaf (Top 16 by date)
mraaf
20-Mar-18 0:47am
View
Hello,
Any idea or tips?
Thanks
mraaf
14-Mar-18 0:23am
View
Well that's what I tried, I'm sure the sequence of producing the a cycle of quadrature is correct (A ON, B OFF -->shift 90deg--> A ON, B ON -->shift 90deg--> A OFF, B ON -->shift 90deg--> A OFF, B OFF), but there are variables such as shift timing (Sleep() in this case), cycle timer (OnTimer()) might need to fix or incorrectly manipulated.
mraaf
14-Mar-18 0:06am
View
Yes, I'm pretty sure I need to fix my coding
mraaf
16-May-17 3:14am
View
I'm using CString::GetAt() to get each character, not sure this is best way but the microcontroller seems to receive all bytes of the string.
CString strAllDigits, strDigit1, strDigit2, strDigit3, strDigit4, strDigit5;
unsigned char pData[5];
strAllDigits.Format("%.2f", dTT126); // 4.00 - 20.00
// Get 1st digit
strDigit1.Format("%c", strAllDigits.GetAt(0));
unsigned char* pDigit1 = (unsigned char*)strDigit1.GetBuffer(0); // 1st char
strDigit1.ReleaseBuffer();
// Get 2nd digit
strDigit2.Format("%c", strAllDigits.GetAt(1));
unsigned char* pDigit2 = (unsigned char*)strDigit2.GetBuffer(0); // 2nd char
strDigit2.ReleaseBuffer();
// Get 3rd digit
strDigit3.Format("%c", strAllDigits.GetAt(2));
unsigned char* pDigit3 = (unsigned char*)strDigit3.GetBuffer(0); // 3rd char
strDigit3.ReleaseBuffer();
// Get 4th digit
strDigit4.Format("%c", strAllDigits.GetAt(3));
unsigned char* pDigit4 = (unsigned char*)strDigit4.GetBuffer(0); // 4th char
strDigit4.ReleaseBuffer();
// Get 5th digit
if(strlen(strAllDigits) > 4)
strDigit5.Format("%c", strAllDigits.GetAt(4));
unsigned char* pDigit5 = (unsigned char*)strDigit5.GetBuffer(0); // 5th char
strDigit5.ReleaseBuffer();
pData[0] = *pDigit1; // First ASCII character of data
pData[1] = *pDigit2; // Second ASCII character of data
pData[2] = *pDigit3; // Third ASCII character of data
pData[3] = *pDigit4; // Forth ASCII character of data
pData[4] = *pDigit5; // Fifth ASCII character of data
SDSWriteFIFO(Ident, (unsigned char*)pData);
mraaf
15-May-17 23:23pm
View
Thanks, try it before but it returns same result. It must be in SDSWriteFIFO() function itself.
mraaf
15-May-17 6:11am
View
And yes, it expects ASCII characters.
mraaf
15-May-17 6:04am
View
Jochen,
Seems the compiler didn't support CStringA. So GetString() doesn't work. I am using VC++ 6.0.
SDSWriteFIFO() is written by me but the parameter has to be unsigned char* as per library.
LPSTR buf = strTT126.GetBuffer(0); // this also pass first byte of the string
SDSWriteFIFO(Ident, (unsigned char*)buf);
strTT126.ReleaseBuffer();
mraaf
9-May-17 7:03am
View
Thank you Jochen, it's make sense now: the missing data must be my missing fields for Embedded Object ID and Service Parameters.
mraaf
9-May-17 5:43am
View
I have fixed the mixed up and remove the loop. However SDS data frame monitor showing missing first 2 bytes while CAN data frame monitor showing all bytes were read.
mraaf
19-Apr-17 6:08am
View
Thank you very much. It works like charm.
mraaf
19-Apr-17 5:39am
View
Hi Jochen,
Below are errors from the compiler:
Error #1:
PCHDSNAPSHOT pBuffer = NULL;
unsigned long u32NeededBufferSize;
pBuffer = malloc(u32NeededBufferSize)
...error C2440: '=' : cannot convert from 'void *' to 'CHDSNAPSHOT *'
...Conversion from 'void*' to pointer to non-'void' requires an explicit cast
Error #2:
CANL2_CH_STRUCT ch1, ch2;
char *pName[2] = {NULL,NULL};
strcpy(ch1.sChannelName, pName[0]);
...error C2664: 'strcpy' : cannot convert parameter 1 from 'unsigned char [80]' to 'char *'
...Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error #3:
int ret;
CANL2_CH_STRUCT ch1, ch2;
PRAEDEF int MIDDEF INIL2_initialize_channel(CAN_HANDLE *pu32ChannelHandle, char *pChannelName); // CANL2.H
ret = INIL2_initialize_channel(&ch1.ulChannelHandle, ch1.sChannelName);
...error C2664: 'INIL2_initialize_channel' : cannot convert parameter 2 from 'unsigned char [80]' to 'char *'
...Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
mraaf
18-Apr-17 6:51am
View
Noted. Sorry about that.
Will get it once I'am back in office tomorrow.
mraaf
18-Apr-17 5:37am
View
Thanks, it looks lot better now. But some of the functions still unrecognizable.
mraaf
30-Mar-17 5:46am
View
Yes, thanks. I have removed it and it works now.
Appreciate it.
Thanks again
mraaf
23-Mar-17 11:06am
View
Ok, appreciate your help. Thanks.
Thinking of doing it differently with same result. It will be about 90 different event strings to be dispathed from 5 child dialogs and log them all in a parent.
Again, appreciate any suggestions.
Thank you
mraaf
mraaf
23-Mar-17 0:20am
View
Hi Jochen,
I added DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC but having error with the second ASSERT.
Please advise.
Thanks
Show More