Hello, I am making an application which requires some form of real time incoporated with multithreading. It need to be exact to less than 1 ms. What is the best method to get this kind of precision timing ?
BeakX
Posts
-
Real time for applications -
Question regarding RTX and .dll filesHello, I am currently converting my win32 application into a .rtss based RTX application. However, my application requires a .dll file which for some reason cannot be opened by my .rtss application. Is there something i must do for my .rtss application for it to be able to open .dll files ?
-
How to fix this warning ?LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /DRIVER specification Thanks :)
-
3 win32 applications running parallelFor one i am not too sure about using threads...so far my experience with thread have been rather negative...i cant seem to find any good references around for multithreading. The application doesnt need to know exactly when to read the file since it is constantly being updated by the 3 applications. Also, i am quite confident that they wouldnt crash... hmm..but is will running 3 applications take up more resources as compared to threading a single one ?
-
3 win32 applications running parallelHello, I have a programming problem which require a great degree of parallel programming, but i not too sure about using multithreading, thus i made use of an alternate method which seem to work so far... I compile 3 different win32 applications A,B and C. Both A and B will output some values to 2 output files a and b using the fprintf method. C will access these 2 files a and b, and output a file c, which would then be read by B again to conduct some operations. I would like to ask: 1.are there any foreseeable problems which i do not know of for using this method ? 2.Would the 3 applications be running almost in parallel this method, or will there be a delay between each of them ? Is the delay significant if any ? 3.Would the multithreading method be better ? What are the advantages and disdvantages between the 2 ?
-
How to solve this warning ?I am currently using rtx for some application and i obtained this warning after i editted some of the settings. I think the /DRIVER setting is required by rtx, but i dont see where the /EDITANDCONTINUE come from. Does anyone know how to solve this warning ? LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /DRIVER specification I am currently using VC 6 and apparently /INCREMENTAL:NO is required for this application... -- modified at 4:34 Thursday 9th March, 2006
-
Wierd warningi recieved this warning : warning C4133: 'function' : incompatible types - from 'char [5]' to 'const unsigned short *' for the first line of the code below hCOM1 = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); I copied the code below from an older program, but i did not get that warning when i tried to compile it. Is there something i am doing wrong ?
-
Problem with Serial Port TransmissionHello, I am using the bit of code below in a function to send instructions thru the serial port to some equipment and also to read off some feedback from the equipment: WriteFile(hCOM1, txbuff, 8, &bytesRead, NULL); ReadFile(hCOM1, rxbuff, 8, &bytesRead, NULL); Power= (((int)rxbuff[6])%4)*256 + (int)rxbuff[5]; When i am testing this function alone, it seem to work perfectly and obtain nice readings. However, when i integrate it with the rest of the program i find that the function gives wierd readings.I later found that this was due to the ReadFile portion reading the recieved portion at an offset, meaning there was some meaningless data before my actual portion of the feedback. eg I expect 255 255 43 ..... instead i get 05 04 255 255 43... I managed to solve this problem by making use of the PURGE command. However, i would like to know, why does the offset of data occurr ? Is there any better way to solve this problem instead of PURGE ? Thanks
-
Using Serial Port communication for dialog based applicationI am currently try to do a dialog based application using the serial port to communicate and control some equipment. However, i find that the behaviour of the windows dialog based application is different from the win32 console application which i written. The win32 application was able to send all instructions and read all the recieved transmission without error. However, when i used back the same functions and write back an almost similar program for my dialog based application, some of the instructions were not sent properly thru the serial port and the recieved transmissions were not read properly. I managed to solve the program of reading the recieved transmission by purging the port before i send an instruction that expect the feedback. However, the dialog based application still causes the equipment to act with a delay, unlike its win32 counter part. My quesitons are: 1) Why is it for the dialog based application i need to purge the port before i expect a feedback in order to read my feedback properly (but i dont have to do so for the win32 app) ? 2) Is there a difference in using serial port for win32 console apps and dialog based apps ?
-
Horizontal scroll and vertical scroll--difference ?sorry i have to ask this...but how do i calculate it ? Thanks
-
Horizontal scroll and vertical scroll--difference ?i am using the code below which i copied from somewhere for an application which uses a vertical scrollable child. now i realise my application need a horizontal scroll also.....can i use back the same code ? void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { int nDelta; int nMaxPos = m_rcOriginalRect.Height() - m_nCurHeight; switch (nSBCode) { case SB_LINEDOWN: if (m_nScrollPos >= nMaxPos) return; nDelta = min(max(nMaxPos/20,5),nMaxPos-m_nScrollPos); break; case SB_LINEUP: if (m_nScrollPos <= 0) return; nDelta = -min(max(nMaxPos/20,5),m_nScrollPos); break; case SB_PAGEDOWN: if (m_nScrollPos >= nMaxPos) return; nDelta = min(max(nMaxPos/10,5),nMaxPos-m_nScrollPos); break; case SB_THUMBTRACK: case SB_THUMBPOSITION: nDelta = (int)nPos - m_nScrollPos; break; case SB_PAGEUP: if (m_nScrollPos <= 0) return; nDelta = -min(max(nMaxPos/10,5),m_nScrollPos); break; default: return; } m_nScrollPos += nDelta; SetScrollPos(SB_VERT,m_nScrollPos,TRUE); ScrollWindow(0,-nDelta); CDialog::OnVScroll(nSBCode, nPos, pScrollBar); }
-
Saving Data to FileI am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) ) Thanks
-
What is the easiest way to do a timer ?thanks a million
-
What is the easiest way to do a timer ?I am currently developing a MFC dialog based application and i need a function----- void Pause(int time) such that Pause(3); will stop a loop(or rather the whole application) for 3 seconds...Pause(n) will stop a loop for n seconds..etc. What is the easiest way to write such a function(preferebly without #including any libraries) ? I have been experimenting with some of the syntax without much success...Can some kind soul please put me out of my misery and tell me how to do it ? Thanks :)
-
Limit to number of edit boxes ?I am currently doing an application which requires a lot of edit boxes, but i have a problem now that i cant add any more edit boxes to my application ! Is there an upper limit to the number of edit boxes in an application ? Is there a way to remove this limit ? What should i do if i do not have enough edit boxes ?
-
Parsing Error with using Control Arraythanks it works !
-
Parsing Error with using Control ArrayI am tryin out a control array with edit boxs, but i encounter the following when i click on class wizard : "Parsing Error: "Expected";" ,Input line CEDIT m_id[17]; " Can someone tell me what went wrong here ?
-
Elegant way of handling a lot of variables ?Oh that is interesting ! =) Can you give more details on how to do that ? I was looking for something like that... Thanks
-
Elegant way of handling a lot of variables ?Hello all, Perhaps this is a rather idiotic question to ask..but i will ask anyway. I am writing a VC++ application with a lot of edit boxes (about a hundred >_<) and thus i have a lot of variables which go like PHASE1_1,PHASE1_2,PHASE1_3.....,PHASE2_1,PHASE2_2..PHASE3_1...etc i find that i have a programming nightmare when i attempt to retrive values from all of them as i have to type out their names individually. Is there any elegant way of handling A LOT of variables which are similar in name, such that it would make the program writing process a lot easier ? Thanks in advance
-
Scrolling Edit BoxsI am making an application using vc++ which requires A LOT of edit boxes and i am unable to fit them horizontally or vertically. Is it possible to make a dialog based application that scrolls edit boxs? Also, due to the nature of the my application i need to keep a portion of my edit boxes in view to read of some data. Can it be done ?